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 named a folder " ", the symbol for a space.

In Linux you can create folders with just a space. Now that I've switched over to Windows, I can't move the folder that has the folder named " " in it. Nor can I move anything in the folder itself, or rename the folder.

I have tried Unlocker 1.9.2, and it didn't work either. It asked me to perform the operation at reboot, I agreed and it didn't do anything.

How can I rename the folder named " " from within Windows?

share|improve this question
10  
Switch back to linux and rename it? –  Raystafarian Dec 30 '13 at 15:25
1  
That is a workaround, not a solution. Though it may well be the fastest way if you got a liveCD lying around. –  Hennes Dec 30 '13 at 15:27
    
no, i don't have a live CD. –  user285603 Dec 30 '13 at 15:33
1  
I am not sure it is possible. http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx states "Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not." A single space also counts as ending with a space. :( –  Hennes Dec 30 '13 at 15:34
2  
Install Cygwin. –  Daniel R Hicks Dec 30 '13 at 17:06
show 6 more comments

6 Answers 6

It's not in fact true that this is impossible on Windows. It is possible to fix this with the SFUA Utilities on the Subsystem for UNIX-Based Applications on Windows 7 (Ultimate edition). I just did so:

JdeBP ~/Desktop %mkdir ' '
JdeBP ~/Desktop %ls -ldQ ' '
drwxr-xr-x  1 JdeBP  None  0 Dec 30 16:14 " "
JdeBP ~/Desktop %mv ' ' space
JdeBP ~/Desktop %rmdir space
JdeBP ~/Desktop %

Instead of using rmdir I could have just deleted the space folder from the desktop using Windows Explorer; or done anything else, including accessing its contents (had it had any).

The problem is not Windows NT itself. It's the Win32 subsystem rules for filenames. The POSIX subsysem doesn't impose the same rules.

share|improve this answer
    
but no way of renaming the folder? –  user285603 Dec 30 '13 at 16:50
3  
The above shows the folder being renamed. –  JdeBP Dec 30 '13 at 16:54
2  
Just to clarify it a way more: The unix way of renaming a file is to m o v e it to a new name. –  Hennes Dec 30 '13 at 17:23
    
Oh...yeah, tried to use it... WAY too complicated for me. –  user285603 Dec 30 '13 at 17:50
6  
@user285603 you just need to download SUA, install it and then run the commands provided here. That's not that hard! What were you expecting? A magic word? –  terdon Dec 30 '13 at 18:57
show 1 more comment

You could try:
Rename the folder using 7-Zip


Tested on Win7 x64 with 7-Zip portable version

Steps to Reproduce:

  1. Create folder (F7) with default name: "New Folder"

  2. Rename "New Folder" to " "

  3. Rename " " back to "New Folder"


This answer is similar to this one which solve "How to delete a folder containing trailing spaces": http://superuser.com/a/366583/163596

share|improve this answer
add comment

The best bet for you to use a live cd of Linux and then rename the folder and then use it windows. AFAIK and others have stated here there is no way to do this using Windows. If I could find a way I would edit my post.

share|improve this answer
3  
Nitpick mode: "There is no way to do this using Windows". No. There is no way to do this using the regular windows API. A windows program which uses its own interface to the filesystem rather than the win32 API can still do this. –  Hennes Dec 30 '13 at 16:45
add comment

As noted, the problem is the Windows user interfaces, not the Windows filesystem.

If you can write in almost any programming language, and that language has a library function which will let you manipulate the filesystem, you should be able to quickly write a minimal program that will let you rename this beast.

Or, as others have noted, you can try using the wildcard approach. ? is a single-character wildcard; if you don't have any other files or directories with one-character names you could try "ren ? foo" and see whether that's enough to sneak past the special-case checks for the space character.

share|improve this answer
add comment

I am running XP so unsure of the specific nuances of Windows 7, but using Cygwin I was able to create a folder named " " containing a few random files, then using the mv command rename the folder and keep its contents.

cd the/path/of/the/parent/folder

mv " " newfoldername

share|improve this answer
add comment

This is definitely untested, but out of curiosity it may be a solution:

  1. Move any other folders that are in the parent folder of your " " folder

  2. Fire up PowerShell, and navigate to the parent folder.

  3. Run Remove-Item .\*

share|improve this answer
    
From the OP: "I can't move anything in the folder." –  Hennes Dec 30 '13 at 15:50
    
@Hennes I took that as a "I can't move anything in the folder that is named a space", not as "I can't move anything in the parent folder". –  Thor Dec 30 '13 at 15:50
    
I could be wrong. Waiting for the OP to add more information on testing things (and really curious how to handle this kind of thing). –  Hennes Dec 30 '13 at 15:51
    
@Hennes We'll just have to wait and see! –  Thor Dec 30 '13 at 15:54
1  
The OP wants to rename it, not remove it, presumably because he wants to keep things in it... –  Izkata Dec 30 '13 at 20:03
show 9 more comments

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.