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

5

1

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.

zneak

Posted 2010-11-03T15:38:45.127

Reputation: 989

Answers

10

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

TataBlack

Posted 2010-11-03T15:38:45.127

Reputation: 919

Superb! Just what I needed, thanks so much. By the way, even with UNC paths, TAB key works. :) So there is no need to type out all the folder names... – syntaxerror – 2015-10-02T00:29:58.170

You're welcome. For the record, I just edited the answer to add a link documenting the "\?" path prefix. – TataBlack – 2010-11-04T08:03:46.703

2

The only way I was able to remove a test directory with a similar name was to use Cygwin.

Paused until further notice.

Posted 2010-11-03T15:38:45.127

Reputation: 86 075

Damn. Well, thanks for testing. I'll see if I can do something similar. – zneak – 2010-11-03T20:22:43.723

Well, it works, but it's certainly not the simplest thing ever. – zneak – 2010-11-04T03:17:27.257

0

Boot from Ubuntu liveCD (download here), mount your windows NTFS disk/filesystem by double clicking it in nautilus. (Click at the top: "Places" menu -> "Computer")

After that, you should be able to access your windows partition and from there remove the directory.

BloodPhilia

Posted 2010-11-03T15:38:45.127

Reputation: 27 374

I'm pretty sure it works; though, isn't downloading 600 MB of software to delete a single directory a bit overkill? – zneak – 2010-11-03T22:41:26.127

@zneak Yes, that's why Microsoft doesn't allow you to create directories like that! ;) Anyway, it's probably the only way without having to install additional software. You might want to try DamnSmallLinux (DSL), which is smaller in size and can be installed to a 64MB USB pen drive: http://www.pendrivelinux.com/all-in-one-usb-dsl/

– BloodPhilia – 2010-11-03T22:44:03.453

Just for the record, TataBlack has a solution that requires no additional software. – zneak – 2010-11-04T01:38:30.280