Monday, July 11, 2016

Cannot delete CON or AUX files .... yah Windows!!

So I had a copy of Cygwin running (for local web server stuff) and once I had done with it tried to delete it.
But no! Windows cannot find the file CON.cif .... oh what? I can see it. It's just there - look Windows, right in front of you!
Anyway, I did come across this in the past with the 'ole CON file thingy. And remembered Windows has several reserved file names :
CLOCK$, CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9 LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

How stupid! Can't you give them device looking names like //CON and //LPT1 etc?? Grrrr.

Ok so if you've ever had this problem, and you've tried cmd line, third party tools, chkdsk, rd, ren, file permissions, Safe-mode, Booting to DOS (lol)  .... basically  everything with no luck.
Well I found this little tidbit online :

rd \\.\c:\documents\con /S /Q
or
del \\?\C:\cygwin\src\linux-3.7.1\drivers\gpu\drm\nouveau\core\subdev\i2c\aux.c

These are "remove dir" and "delete" methods, specifying the current computer first ( \\. or \\? ).
I think this also means that you could delete the file from another PC on the same network :) 

Hope this saves someone!





11 comments:

Unknown said...

You saved me. Thank you!

Unknown said...

for realsis!! ace

Sir_-_Jeff said...

LAL! I just discovered how to "moderate". Such a noob!

Unknown said...

THANK YOU THANK YOU THANK YOU

Unknown said...

oh my god i love you

Unknown said...

months that has been bugging me! Thank you!

Pavlov said...

Wow. Thanks a lot!

Unknown said...

YOU'RE A GOD !!!

Anonymous said...

Saved another... TY

Anonymous said...

Saved me!

Anonymous said...

You are my absolute and eternal hero. Thank you.