Virus cleanup – unable to delete directories named “con.” and “nul.”

A barnch office in China had a virus incident where a workstation was infected with a virus, this virus created two directories on a server share named “con.” and “nul.”.  I quickly discovered that “con” and “nul” (and also “aux”, “lpt” etc etc) are protected names in Windows and you can’t create directories with such names, well you can actually by ‘cheating';

Create dir;

md \\.\c:\con
md \\.\c:\nul

Remove dir;

rd \\.\c:\con
rd \\.\c:\nul

This is all well and good, but it does not work for folders named “con.” and “nul.”, my next thought was well perhaps there is a ‘hidden’ character after the “.” (eg. the ALT+255 char) so I piped a dir to a text file for examination (dir c:\ > output.txt) however no luck it simply ended with the “.” and that was that.  Checkdisk had no luck and utilities to unlock files had no luck.

Anyhow I put it on Technet forums and “Brent Hu” was kind enough to offer some useful advice, he pointed to a utility called “DelInvFile” from here;  and in seconds the two directories was gone :-D  nice… and as the software came with 3 free deletes it did not even cost a penny, excellent.  Anyhow, if you experience invalid files/directories in your directory structure take a look at this util, it may just save your day :-)

1 reply
  1. garrydam
    garrydam says:

    I just download and use “Long Path Tool” guarantees to fix your error fast and easy.

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>