Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a folder on my desktop which is named ".." (which itself contains subfolders with an empty name). The folder can't be deleted the usual ways, even not when using the CLI. Does anyone know how I can remove this folder on Windows Vista 64bit?

Renaming does not work, too (obviously).

This is what "dir /x" echoes:

09.10.2009  15:04    <DIR>                       .
09.10.2009  15:04    <DIR>                       ..
08.03.2007  11:18    <DIR>                       cgi-bin
               0 Datei(en),              0 Bytes
               3 Verzeichnis(se), 45.866.037.248 Bytes frei
share|improve this question

migrated from stackoverflow.com Oct 9 '09 at 13:18

This question came from our site for professional and enthusiast programmers.

    
When you do "dir" in the command line on the Desktop folder, does it show ".." twice? –  hasenj Oct 9 '09 at 13:45
    
Explorer doesn't normally turn "." and ".." into icons on the desktop, so I expect it will. –  quack quixote Oct 9 '09 at 14:09
    
my point is, maybe that folder contains some invisible characters of some sort –  hasenj Oct 9 '09 at 14:25
1  
Apart from trying to delete it: how did it get there? Seems time for a thorough malware and virus scan? –  Arjan Oct 9 '09 at 14:56
    
I did a backup of a webserver (zipped it there) and unzipped it locally, and strangely there were two folders "." and ".." in it. –  acme Oct 14 '09 at 6:51

10 Answers 10

up vote 8 down vote accepted

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.

share|improve this answer
    
since it's an icon he's looking at i think it's likely the real file/folder name is " .." or something similar. –  quack quixote Oct 9 '09 at 14:20
    
".." was indeed the real folder name, but it worked with the \\?\-syntax! Strangely it issued a warning first ("Syntax for foldername, directory name or drive letter is wrong") but the folder was removed nevertheless. And another folder named ".", which I tried to delete afterwards this way was deleted without any messages when I added the "/S"-flag. Thank you! –  acme Oct 14 '09 at 7:02

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.-
share|improve this answer
4  
probably want "rmdir /S 5C51~1.-" -- he said it contained a subfolder. –  quack quixote Oct 9 '09 at 14:16
    
I did dir /x but strangely the column with the proper name is empty. –  acme Oct 14 '09 at 6:50
    
I added the output to the question (see above) –  acme Oct 14 '09 at 6:52
    
The short name (the "proper name") is only shown if it's different from the long name. But: too bad that apparently Windows only shows one instance of ".." when in fact there kind of are two... (In the answer above, the second ".." has a leading space, which in the question was not there.) –  Arjan Oct 14 '09 at 9:54

[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).

share|improve this answer
3  
Technically .. is not a forbidden name for a folder on Windows. If you use the native kernel-level API (which is very much unlike the normal Windows API) I'm fairly sure you can create such folders. NTFS doesn't forbid it, afaik. I created folders named * or ? in the past using SUA. –  Joey Oct 9 '09 at 13:22
    
Yeah, the typical ".." is a link back to the parent directory from the subdirectory. But I can't imagine what you'd have to do to Explorer to get it to show that as an icon on the desktop. –  quack quixote Oct 9 '09 at 13:44
    
That's so strange about windows, or NTFS. It allows filenames with some strange chars, but then you can't delete or do anything with them. For instance, with Mac OSX, I created a file with colons in its name, on an NTFS partition. Windows shows it, but you can't open it, move it, rename it or delete it. –  Petruza Oct 9 '09 at 13:58
    
@Johannes: it's illegal on WinXP at least. Dots and spaces aren't allowed on the end of a directory; you can't create them normally via commandline or Explorer. –  quack quixote Oct 9 '09 at 14:07
7  
That's because the NTFS specs don't have any issues with colons or stars or question marks since it doesn't have any idea what a wildcard or drive letter is. In fact, almost all of those "special" characters are imposed by the operating system since it does have special meaning, in fact you're allowed to create a filename with a \ or / in there since directories are handled differently in raw NTFS than how Windows/Explorer/etc. handle them. So the reason OSX and Linux can use special characters is the OS has no issue with it, and neither does NTFS - so the OS sees no reason to block the name. –  Joshua Oct 9 '09 at 14:08

Navigate to your desktop in a command window ("cd C:\Users\YourUserName\Desktop"). Type "DIR /X" -- this will spit out a directory listing.

There will be two entries at the top named "." and "..". Look for another ".." AFTER that, in the right-most column. Does it have another name in the next column? That's the short filename. Type "rmdir /s [short-filename]". Reread what you typed. Reread again -- make absolutely sure you typed it right before you hit enter.

Do NOT run "rmdir /s .." -- bad things will happen.

share|improve this answer
    
Thanks, but strangely there is no proper name with dir /x echoed - I added the output to my question above. –  acme Oct 14 '09 at 6:53

Did you try chkdsk or similar? (Don't know if there is chkdsk on vista.)

share|improve this answer

Suggestion (1) Login as a different user, move all your valid files out of Desktop directory, then delete/recreate it.

Suggestion (2) Win32 unix tools usually work a bit better than the cmd equivalents, so I would give them a go. At the very least they're worth installing:

http://unxutils.sourceforge.net/

share|improve this answer
2  
They are bound to the same restrictions as anything else running atop of the normal Windows API. –  Joey Oct 9 '09 at 13:21

As I never saw a directory with that name, I can only suggest to try using old DOS.
Use in the Command Prompt, or cmd.exe, the dir command with the -x parameter.
If the file is displayed with any other name than "..", use the del command:

del file~1.MOV

If this doesn't work, try:

del ".."

Otherwise, move everything else out of the directory and use implicit del:

Del *.*

then return the moved files back.

share|improve this answer
1  
There is no DOS emulation in x64 Windows anymore. cmd is a native Windows application and doesn't share much with DOS, except parts of the command line syntax. –  Joey Oct 9 '09 at 13:44
    
How much of what I advised was possible to try within this cmd? –  harrymc Oct 9 '09 at 16:56
1  
I tried it as someone already suggested it above but there was no real name issued, but deleting it with the "\\?\"-syntax (see above) did the trick. –  acme Oct 14 '09 at 7:03

I think Unlocker can help you. It is a very simple tool and works with vista x64.

share|improve this answer
    
good suggestion, but would you change your link to ccollomb.free.fr/unlocker ? probably better not to link directly to an exe on this site. –  quack quixote Oct 9 '09 at 14:56
    
I change it. It is forbiden to direct link an exe file? –  telebog Oct 9 '09 at 15:05
1  
No, but if the version changes, the direct link becomes somewhat pointless. –  EvilChookie Oct 9 '09 at 15:06
3  
plus, some people want to see more information about a tool before downloading it. –  quack quixote Oct 9 '09 at 15:22

To the poster above who said to enter "del ..", do not do this. It will prompt you 'Are you sure (Y/N)?' and answering Y will delete all files in the directory BELOW. Sorry for posting in the answer box, but I only joined yest and can't post comments yet.

Try boot a Linux Live CD and remove the '..' directory through there.

share|improve this answer
1  
linux will do the same thing. –  quack quixote Oct 9 '09 at 14:17

Boot with a Linux live cd and make sure you have access to the hard drive, ... then in terminal run:

sudo rm -R /path/to/file/or/folder/named/..
share|improve this answer
4  
BAD IDEA. .. is special on Unix too. "rm -r /path/to/file/or/folder/named/.." will delete "named" and everything under it. –  quack quixote Oct 9 '09 at 14:12
1  
Might work if you use -i and are veeerrry careful. –  quack quixote Oct 9 '09 at 14:13
    
It seems like its a normal .. dir after all! Which noone should delete and does not contain anything.... –  Aaaaaaaaaha ERLEBNIS Oct 16 '09 at 13:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.