9

Recently, I loaned my flash disk to one of my friends, who had Mac OS. He copied a file on it, whose name included a backslash (\).

The flash disk is NTFS formatted. Windows does not allow such filenames, and neither opens the file, nor deletes it, nor lets me delete the file.

There are naive approaches to this problem, like:

  • Formatting the flash disk;
  • Giving it back to my friend and asking to rename it;
  • Loading into some live Linux and renaming it.

However, I'm looking for something more clever, like a program that can do the trick under Windows.

PS: There's a tool called NTFSWalker which can browse the MFT records of the NTFS, but is unable to make any changes to them.

3
  • 2
    You'll find How to force Windows XP to rename a file with a special character? a useful read as well - the only real answer there was to use Linux.
    – DMA57361
    Nov 24, 2010 at 18:33
  • Try Check Disk. (Right click on disk icon → Properties → Tools → under Error-checking, click Check Now → check Automatically fix file system errors.) This was one of the suggestions in the linked question above, but was never tried.
    – Bavi_H
    Nov 25, 2010 at 4:32
  • @Bavi_H: Sorry, Check Disk did not work either. Nov 25, 2010 at 9:21

4 Answers 4

5

All Win32 APIs use the backslash as a directory separator. There is a slight chance that the POSIX subsystem accepts it as part of the file name, so you could try mv from Services for Unix.


I wouldn't say using Linux to fix is "naive", if Unix was what broke it in the first place.

7
  • I tried mv before. It didn't work. Nov 24, 2010 at 19:36
  • About "naive": I meant some solution that comes to mind at the first place. Nov 24, 2010 at 19:38
  • @Sadeq: Which mv are you talking about? Nov 24, 2010 at 20:04
  • 2
    @Sadeq: Both of them are plain Win32 programs. I explicitly mentioned Services for Unix for a reason — its programs run in a separate "POSIX" subsystem, with different rules than those of Win32. Nov 25, 2010 at 12:58
  • 1
    The POSIX subsystem also uses NtOpenFile to open files, and NtOpenFile treats the path as a whole, not as a series of components (there's a flag to use "POSIX" semantics, but that's only for case sensitivity) -- so it follows the same rules.
    – user541686
    Jan 22, 2012 at 8:24
3

I've found that 7zip can often deal with strange files when Windows fails (useful for paths that are too long to delete normally) - give that at try.

3
  • Sorry. 7z gives the same error as Windows. Nov 24, 2010 at 19:37
  • Doesn't work for me either Feb 29, 2012 at 5:28
  • 2
    7z worked some magic for my case, which was filenames ending with a non-compliant space character. I tried a ton of utilities for dealing with this but only 7z worked. Aug 29, 2013 at 23:19
2

You can use CHKDSK /F from DOS prompt to fix the errors, and then RD /S <DIR> where <DIR> is the directory you want to delete. Be careful as this will delete the directory and all its sub-directories.

-1

I opened the folder with inaccessible character files in 7zip file manager. There, I renamed it and BINGO, it got renamed. Thus I was able to access the file.

7zip is a freeware file compression utility, better than RAR.

1
  • 5
    Isn't your answer the same as Dentrasi's? Nov 10, 2011 at 10:02

You must log in to answer this question.

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