1729215217-Cannot-delete-CON-or-AUX-files.gif

Cannot delete CON or AUX files


Author:
Dwayne
Published in:
Tech
Published date:
Oct 18, 2024 01:33am
Post ID:
28
Tags:
tip

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!


Please register or sign-in to comment

© Copyright 2024 , OMI Ltd. and S.Dwayne Pivac. All rights reserved.