Thursday, 18 July 2019

filesystems - Under Windows 7, how can I delete a folder whose name ends with "..."?


A friend with Windows 7 somehow managed to create a folder on her computer whose name ends with "...".


Normally, Windows won't let you create folders with names ending like that. I really don't know how she managed to do it.


The Windows Explorer doesn't suffer from it too much, as all files inside are accessible and can be manipulated normally. However, it's impossible to rename it or delete it. Worse, it's impossible to delete the parent folder as well.


It can't be reached through the command line as it says the file doesn't exist.


Anyone knows a way to fix that? I don't mind to blow it up as I can move files from and to it through the Explorer normally.



Answer



You should be able to delete it using the "rd" command, but with a different syntax:


rd "\\?\DRIVELETTER:\FOLDERNAME"

The FOLDERNAME placeholder should, of course, be the actual name of your problematic folder, dots included.


If the directory is not empty, you would receive an error message. To force deletion of the directory and its contents, you can use the /s switch:


rd /s "\\?\DRIVELETTER:\FOLDERNAME"

The "\\?\" path prefix is documented here, under "Win32 File Namespaces":


http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...