Handling spaces in names of directories, Command Prompt

Status
Not open for further replies.

LatinusRex

Honorable
Jan 1, 2013
15
0
10,520
Hello,

This has been a problem that I cannot seem to find an answer to. I want to be able to change the directories of Command Prompt using the "cd" command when the directory's name has a space in it. I boiled this problem down to trying to access a folder named "x x". When I am in the folder itself (i.e., I start Command Prompt from within the folder), it gives the directory name of "XX014B~1" for the folder. When I type in:

cd XX014B~1

That directory is accessed successfully. Now I am not aware of any way I should know that that specific folder's name should have "014B" appended to it. When I check its name using the "dir" command, it comes up as it does in the GUI, "x x". Here is a list of commands that I have tried to access the folder:

cd x x
cd "x x"
cd x\ x
cd "x\ x"
cd x~1
cd xx~1
cd x*
cd xx*
cd \x x
cd "\x x"
cd x_x
cd \x_x

I have tried a few more things (such as tab completion, which just inserts a tab). I have looked at at least 10 different websites offering "solutions" to this, yet none of them worked. If it makes any difference, I am running on Windows Vista. Is this something that just cannot be done in Command Prompt? Or is this more a case of ignorance. Any help is greatly appreciated.
 

LatinusRex

Honorable
Jan 1, 2013
15
0
10,520

I tried that as well, yet hitting the tab button only inserts a tab and not the folder name.
 

LatinusRex

Honorable
Jan 1, 2013
15
0
10,520
Well, it appears that this is case of ignorance. I was using command.com instead cmd.exe...

Using cmd.exe made all the difference and everything works now. Thank you for your help.
 
Status
Not open for further replies.