I have some files on my C drive with colons in their names. I'm pretty sure they were created in some Linux distro I used before. I know Linux supports colons in file names, while Windows does not. Linux even allows saving files with colons on Microsoft's NTFS file system. I currently don't have the Linux distro installed. I only have Windows installed. So now that I'm back in Windows, how am I supposed to open this file? Install Linux again? Renaming doesn't work, because I get an error. Is there no way to open these files in Windows without using Linux? They are PNG picture files, so Windows can read them, but it doesn't find them because the file paths are invalid.

If I double click on one of the files, Windows Photo Gallery tries to open it and reports:

There are no pictures or videos selected.

If I try to open it in Microsoft Paint it reports:

C:\file:name.png contains an invalid path.

If I try to rename it in Windows Explorer (e.g. replace colonns with underscores) it reports:

The file name you specified is no valid or too long.

Specify a different file name.

Following characters are forbidden in file names in Windows.

A file name cannot contain any of the following characters.

Surely, Linux developers must be aware of these restrictions? I don't see why they would allow Linux to save colons in file names on NTFS partitions... doesn't make sense. Even if Linux itself can read them, chances are that these partitions are read in a Windows system as well (in case of dual boot or shared disks).

These files were named and saved automatically, so it's not my fault the colons were introduced in the names.

  • Did you try renaming from DOS/Command Prompt and substiting the ? for the colon? – cybernard Feb 10 '14 at 1:02

There is also the option of booting with a Linux live cd (as opposed to installing as dual boot) and renaming the files. That's probably the quickes/easiest imo.

| improve this answer | |

You can enable File Name Character Translation to work around this issue.
You will have to modify your registry for file name character mapping to replace characters that are not legal. And since you will be modifying the registry, the standard warning applies.
Windows tutorial here

| improve this answer | |
  • 1
    And what if I don't have the HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS key? Can I just create it and hope it will still work? Does Windows Vista natively support Microsoft SUA subsystem? Or will I have to download some SDK for this to work? Will this work at all on a client Windows system? Or is this Windows Server only? – Samir Feb 10 '14 at 21:48

I had a similar problem and my solution may work for you. I tried to rename the last 4 episodes in a folder and I was getting the message:

"A file name cannot contain any of the following characters. \/:*?<>|

The weird thing is I had 12 Episodes within this file and the first 8 of which I had no problem adding a "#" to the end of the episode name to remind me which one I'd watched.

To fix this problem I went to the keyboard icon on the bottom right hand corner and changed the keyboard to English UK, I would imagine if you had a US keyboard then changing it to that style would also fix the problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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