How to fix a directory that is there but doesn't exist?

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.

Solution 1:

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.

Solution 2:

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.