I have some files with 'impossible filenames'. I'm not talking about special characters or anyting, but really impossible ones. (filesystem NTFS)

One file is called images\receipt.jpg (yes, this is just the filename, not a path+filename)

another is called ..\..\data\

another is called "\n" (a single newline, escaped so you can see it here)

They are created by Ubuntu, when I saved/moved files with my Windows-mind (I don't know how the third one is created). I don't have any Linux or live-CD anymore.

I've tried every suggestion in previously asked questions, but maybe something new is possible since 2 years ago.

CHKDSK /F /X doesn't work

Using the 8.3 filename doesn't work (there are no 8.3 filenames for these files)

REN doesn't work

RD /S doesn't work

7-Zip doesn't work

I can't even defrag the disk because the defragmenter trips when it encounters these files during analyzing.

I tried programming my own rename function, but without low-level system calls (kernel32 defrag api comes to mind, but is too dangerous to just try), it keeps ordering path elements by '\' characters, so it can't find "receipt.jpg" in folder ~~/"images/", etc.

Is there any program that I can use to rename/delete them? Perhaps something like PCTools (20yo DOS program) that can 'edit' the sectors like a Hex editor?

  • In the end, I resolved to progressively shrinking the partition, copying everything to another partition which I progressively grew, until the only thing left on the old partition are the offensive files. Now I have a partition with all my data and a 1gb partition with the strange files. – Mark Jeronimus Mar 22 '12 at 6:08

By default, every file and directory under an NTFS filesystem has two names by which it can be accessed: the long filename and the short filename. Short filenames follow the 8.3 naming convention which you may be able to use to delete these files by using the Command Prompt. For example:

C:\>del C:\example\IMAGES~1.JPG

You can learn the short name for a file by issuing this command dir /X (that's a capital X.)

Since short filenames are an optional feature of NTFS it's possible that these files don't have short names. In which case, you might be able to do it by using the extended length path form of the files' paths. You do this by prepending \\?\ to the full path of the file, enclosing it with quotes:

C:\>del "\\?\C:\Example\images\receipt.jpg"

If all else fails, go and download another Linux Live CD and delete them from there. There are smaller distros available if an Ubuntu download is too large.

  • As I said, there are no short filenames available. Extended path also doesn't work. – Mark Jeronimus Feb 29 '12 at 10:23

Try FreeCommander. (via this forum thread: (Solved) - help renaming after ALT+255)

Also the ALT key trick for entering otherwise invalid filename characters might work:

  • Hold down Alt while entering the ASCII code number of the character to enter that character.
  • For example, hold down Alt and type 092 on the numpad to insert \; 013 to insert \n
  • You may need to use four digit numbers like 0092 and 0013...

Personally, I'd just make a quick LiveLinux usb and fix it from there. Is there a reason you can't use Linux?

  • Why would anyone do Alt+92 when you can just type a \ and get the same result? I cannot type a linefeed because it will just interpret it as an Enter press. FreeCommander fails too. Same reason, file not found . – Mark Jeronimus Feb 29 '12 at 10:28

protected by Dennis Jan 26 '13 at 3:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.