4

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.
fixer1234
  • 27,064
  • 61
  • 75
  • 116
laurent
  • 5,979
  • 17
  • 47
  • 71
  • I suggest you use a live Linux environment. – Ramhound Dec 03 '15 at 14:37
  • Dumb but effective: backup, format, restore. – beatcracker Dec 03 '15 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 04 '15 at 04:26
  • @dxiv, I have updated my question with more info. – laurent Dec 04 '15 at 08:32
  • Also dumb but effective: Since you can open it from explorer just copy all thhe files to antoher directory (without extra space at the end of the name). – Hennes Dec 04 '15 at 08:33
  • @beatcracker: Yes, it's dumb but no, it's not effective for this kind of problem. – Alex Essilfie Dec 04 '15 at 09:38
  • @AlexEssilfie Would you care to explain why it's not effective? OP is clearly not interested in saving data from this folder. – beatcracker Dec 04 '15 at 09:51
  • @beatcracker: See [my answer](http://superuser.com/a/1009006) below for the solution. – Alex Essilfie Dec 04 '15 at 10:15
  • 1
    Directories like this can be deleted directly with `rd /s "\\?\D:\Docs\Photos\2000\01-01 Abcdéf abcdef abcdef \"` (https://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 04 '15 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 09 '20 at 14:34
  • @5202456 Glad it helped, though it technically doesn't answer OP's question to "fix" rather than "delete". – dxiv Mar 09 '20 at 20:44

4 Answers4

6

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.

Rohit Gupta
  • 2,721
  • 18
  • 27
  • 35
  • 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! – Alex Essilfie Dec 04 '15 at 15:46
  • @AlexEssilfie, I know. It was an example. – Rohit Gupta Dec 04 '15 at 20:31
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.

Alex Essilfie
  • 1,385
  • 2
  • 12
  • 23
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.

FatalBulletHit
  • 363
  • 5
  • 18
-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.

umedia
  • 1