I have some files that contain colon character in the filename (eg. 1d67c0d23e859ed4a259749e4a720d9e:default-sink). When I try to remove them from command line with the command:
c:\backup> del /F *.*
I get "The system cannot find the file specified." for each file. If I specify an individual file:
c:\backup> del /F "1d67c0d23e859ed4a259749e4a720d9e:default-sink"
I get "The filename, directory name, or volume label syntax is incorrect.". If I try to use rd on the parent folder I get
How can I remove these files?
There is a Microsoft KB article listing possible ways to delete such files at:
http://support.microsoft.com/kb/320081
The way I typically use is the native API method:
According to:
http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx
The
:
is a reserved character on NTFS, the native API method I mentioned above is the recommended way to delete such files.I guess you can try the 8.3 name?
Note that on NTFS drives you can explicitly disable the 8.3 functionality, so if that's the case you're outta luck for this option. To get the file name dir a
dir /x
There used to be a freeware tool called
delinvfile
but they've gone and changed it to shareware/paidThis worked for me:
chkdsk /f
Close all the files, if any opened, that are saved in the drive which is containing such files. Now, Open the drive properties.
"My Computer" -> "Right Click on the this drive" > properties
Then, go to "Tools" tab and click "Check now" under 'Error checking' label.
Click here for larger image
This will unmount your drive and will scan the complete drive for errors, eventually it will delete such files with illegal names. On finishing it will show a messages saying some files were fixed.
I successfully deleted such files from my external hard disk.
I have Subsystem for UNIX-based Applications installed on my PC (Windows 7). From the Windows shell, I can create a file with
touch 1d67c0d23e859ed4a259749e4a720d9e:default-sink
, then remove it withrm *:*
7zip can delete files that Windows fails to; I've used it in the past when dealing with overlong filenames, but I've never tried it on files with colons in. They would normally be used to denote ADS.
Try renaming the parent folder to a single character (a, 1, etc.) and then try to delete the parent folder. If it doesn't work then move to the first child folder and rename it to a single character and try the delete again. I often use this method for files with invalid characters (don't ask me how they get created because I don't know) or for files where the path exceeds the maximum (again, don't ask how this occurs).
I have a dual boot system, and non of the above answers worked for me. If the file is located in a disk that is mounted by your other OS (Ubuntu 16.04 LTS for me) you can simpy delete it using your other OS ;)
Have you tried quoting the filenames? Giving the exact command that you're running would be handy.
Have you tried using a wildcard? For instance 'del 1d67c0d23e859ed4a259749e4a720d9e*.*' might work.