Computer Hope
Microsoft => Microsoft DOS => Topic started by: JL2 on January 24, 2021, 07:21:03 PM
-
Hello,
new to board.
I made an error in the way I named a folder on my computer that didn't present itself a problem until recently.
The folder name structure is: Name1 & Name2
Recently while trying to solve another issue, I needed to change to that directory using c:\cd Name1 & Name2 and that ampersand prevented me from accessing the folder because I don't know the syntax to use.
Would someone be so kind to help me please?
-
Try putting the folder name in quotes like this: cd c:\"name1 & name2"
-
thank you strollin for your reply, however, that did not work.
I've also tried cd name1""^&""name2
-
Rename the folder with no ampersand...
-
Renaming the folder as suggested by patio will also work but isn't necessary. The quotes will work provided you typed the command correctly. The syntax you attempted: cd name1""^&""name2, will work fine as long as you simply use quotes like: cd name1" & "name2 (don't forget the spaces before and after the ampersand).
-
thanks again for your response but I'm unable to get the result I'm looking for. I have read your instructions carefully.
I was able to find a solution on another board.
Make sure to be in the directory where your folder is located. In this case c:\users
type: cd name
press the TAB key
result: "name & name2"
press ENTER
result: c:\Users\name & name2 You are now in the directory
Thanks again
-
Glad you found a way to do it, the method I posted has worked fine for me for many years.
Another command that would work: cd c\users\Name1*
-
Best practice is to quote around the full path for any command you are using with file or folder paths.
cd "c:\name1 & name2"
cd "name1 & name2"