Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
These files were created on the NTFS partition when I was booted into Linux. Guess I will have to use Linux boot disk as it seems windows doesn't like colon in filenames at the file system driver level. –  grom Feb 3 '10 at 6:18
add comment

9 Answers

I guess you can try the 8.3 name?

del /F 1d67c0~1

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/paid

share|improve this answer
add comment

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:

del "\\?\c:\path\1d67c0d23e859ed4a259749e4a720d9e:default-sink"

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 method I mentioned above is the recommended way to delete such files.

share|improve this answer
    
This doesn't work for the colon, as it is interpreted as a named data stream. –  psusi May 3 '13 at 18:06
add comment

This worked for me:

  1. Ran chkdsk /f
  2. Rebooted PC
  3. Then I was able to select and delete the file
share|improve this answer
add comment

Have you tried quoting the filenames? Giving the exact command that you're running would be handy.

share|improve this answer
    
I have added it to the exact command I'm running to question. –  grom Dec 22 '09 at 2:57
add comment

Have you tried using a wildcard? For instance 'del 1d67c0d23e859ed4a259749e4a720d9e*.*' might work.

share|improve this answer
    
You I tried wildcards. No luck –  grom Dec 22 '09 at 2:55
    
The next thing that I think of is to boot the system with a linux cd (like system rescue cd), mount the volume there and try the delete from there. You might get interesting results at that point, as who knows what's really going on in the filesystem. –  Michael Kohne Dec 22 '09 at 18:32
add comment

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).

share|improve this answer
add comment

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 with rm *:*

share|improve this answer
    
POSIX compliant utilities (such as SFU) can delete such files. –  Ausmith1 Dec 23 '09 at 1:00
add comment

Have you tried dir /X to find out the actual 8.3 name, and then tried deleting that name?

Or, could that file have an alternate data stream? You might want to look at it wil the tool at http://www.nirsoft.net/utils/alternate%5Fdata%5Fstreams.html to see what that can tell you (I've never used that tool, it just came up when I searched).

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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