How to remove a directory called C: under Windows?

I read this question:

How to delete (invalid) files with colon in their name under Windows?

This doesn't seem to work for a directory named C: though.

I have a directory named F:\VM\C: any chance to remove it using Windows?

I tried rmdir "\\?\F:\VM\C:" which didn't work.


Solution 1:

If you are definitely not concerned with the contents of the folder in question, running a chkdsk on the volume may end up being a quick fix for you, especially if there are indeed behind-the-scenes problems that may need fixing too:

chkdsk f: /f /v (the /v so you can see what's going on + you could always run it without the /f in read-only mode first to see if it actually finds anything wrong to fix)

Note - there is always the chance that running a chkdsk can screw your data up so always ensure that you have a backup.