5

I've got a folder that I cannot rename, delete or copy. I can open it in Explorer and see what's inside, but anything else results in an error saying that the directory doesn't exist.

I've tried running chkdsk on the drive, I've tried checking the directory permissions as well (but cannot because it doesn't exist). I've also tried renaming it with IOBit Unlocked but it didn't work.

That mainly causes problems when doing backups because this directory ends up being excluded.

Any suggestion on how to fix it?

Edit: to add some details:

  • The path looks like this: D:\Docs\Photos\2000\01-01 Abcdéf abcdef abcdef \ (48 chars)
  • I've just noticed it ends with a space, if that can make a difference.
  • It contains a special character "é".
  • It was created by rsyncing files from an Ext3 drive to an NTFS one
  • Many other directories have the same characteristics (special chars, imported from Ext3), but don't have this problem.
  • The drive is not shared and no recent virus infections.
11
  • I suggest you use a live Linux environment.
    – Ramhound
    Dec 3, 2015 at 14:37
  • Dumb but effective: backup, format, restore. Dec 3, 2015 at 14:37
  • Some details would certainly help. For a starting point, are there any special characters in that name? Is it a very long name, or very deeply nested? Is it one of the standard Windows directories (which), was it created by some app (which), or by yourself (how)? Was the directory always inaccessible, or just became so at some point in time? Any recent virus infections? Do you share the drive (via dual boot or otherwise) with a non-Windows OS?
    – dxiv
    Dec 4, 2015 at 4:26
  • 1
    Directories like this can be deleted directly with rd /s "\\?\D:\Docs\Photos\2000\01-01 Abcdéf abcdef abcdef \" (support.microsoft.com/en-us/kb/320081) but unfortunately ren doesn't work with the ` \\?\ ` syntax to rename them, so you'll be better off with one of the other answers.
    – dxiv
    Dec 4, 2015 at 17:59
  • 1
    @dxiv This was the only solution that worked for me, all the other answers did not work. If you post it as an answer I will give it an up vote. Thank you.
    – 5202456
    Mar 9, 2020 at 14:34

5 Answers 5

7

I get many of these from extraction of archives. This method works for me

Open Command Prompt and type the following in pressing Enter after each

D:
cd \Docs\Photos\2000
dir /x

Note the short name for the folder, it has a tilde in it. It will probably be 0101AB~1 Just rename it

ren 0101AB~1 idiotwin

Go back to explorer and you can do what you want with it.

3
  • In my experience, short file names do not always end with ~1. Depending on the number of files (or folders) whose file names start with the same string, the short file name can go from filena~1 filen~25 assuming there are 25 files whose names start with "filename". And depending on the scenario, it could be much more! Dec 4, 2015 at 15:46
  • @AlexEssilfie, I know. It was an example. Dec 4, 2015 at 20:31
  • Thanks.. after renaming i had to shutdown and restart my PC, and then Windows 10 was able to delete the folder .. much appreciated! Sep 23, 2023 at 13:51
4

You're experiencing this problem because Windows does not handle file names (and folder names) that end with a space or a full stop properly.

You can solve this problem you're having by putting the affected folders in a Zip file, deleting the originals and then restoring the contents from the Zip file. Be sure to open the Zip file in Windows Explorer when you are extracting the contents so that Windows Explorer names the files in a manner that it can access. Using a different program to extract the Zip file could cause the defective names to be persisted.

An alternative is to rename the affected folders while they are in the Zip file. This will cause the names to be corrected in the zip file even before they are extracted, giving you a hassle-free extraction process. The downside to this approach is that depending on the program you use and the number of items you have to rename, this can take quite a while to complete.

2

The accepted answer didn't work for me, so I used 7-Zip File Manager to rename the folder in question which made it editable again.

0

It's ironic that this is a problem that if not solved could lead problems when using Github on some IDEs like Eclipse.

2
-1

Actually just do a search for an item in the affected folder, select properties of the that file and then"open file location". Once this is done copy or cut the contents and move them to a folder the lame O/S called Windows can work with and paste... done.

1
  • 1
    Given that the question says that the OP can already open the folder in Explorer and “see what’s inside”, this seems like an unnecessary complication. Sep 30, 2017 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .