How to delete ".."-folder under Windows?
dir /x will tell you the proper name of the folder.
09/10/2009 15:05 <DIR> ..
09/10/2009 15:05 <DIR> 5C51~1.- .. -
29/09/2009 13:14 <DIR> BUSINE~1 .businessobjects
Then you just have to delete the folder using that short name.
rmdir 5C51~1.-
You can use the special \\?\
syntax to try and remove the directory. Try as I might I was unable to create a directory with just ..
in it, but was able to create a file with a space before it and .. (so ..
) and explorer and normal tools were unable to remove it.
To use the \\?\
syntax you have to fully qualify the path. e.g.:
rmdir "\\?\C:\Users\acme\Desktop\.."
Try pressing the tab key to cycle through directory names on your desktop once you get tot the final \
after Desktop
. If you do, Windows will start auto-completing the directories that exist under that folder. I suggest this since the actual directory name could be something like ..
or ..
which would cause the above command to fail with "Cannot find directory".
EDIT: If it isn't a directory but a file (explorer may show it's a "directory" since ..
points to the parent directory) you can use the same \\?\
syntax with the del
command.
[A note, given the upvotes: the question is not about the regular Dos or Unix-like "." and ".." for the current and parent directory. It's really about a folder with that name. So, the answer below does not apply. AvB.]
Correct me if I'm completely misunderstanding the question, but in Windows ".." is the current folder's parent.
That is, from the command line, doing cd ..
while in the Desktop folder, will take you to its parent (C:\Users\username\
on my x64 Win7 machine).