How to Delete Files with Colon in Their Name Under Windows

windowswindows xp

I've got a rather large number of files on my Windows drive that have a colon in their name. (These came from unpacking some Unix archives.)

When I try to delete them, Windows (XP) complains that the file does not exist, and refuses to delete it. This happens when trying to delete or rename it from explorer or the command line. Still, chkdsk does not complain about those files nor fix the problem.

Any ideas on how to get rid of them?

Best Answer

You may be able to use this syntax (per Microsoft KB 320081):

del "\\?\c:\path_to_file\bad:name.ext"

See also this serverfault question on the same topic, "delete file containing invalid characters in windows".

I think the old "ntfsdos" sysinternals utilities could remove/rename these files as well, but these are no longer available post-MS acquisition.

Related Question