Cannot cd to a folder with spaces in the the folder path

You need to surround the path in double quotes if there is a space in the path!

cd "C:\Program Files"

Type cd c:\ . Now press the tab key (this is auto-complete, which will save you a lot of typing) repeatedly until it shows you a directory with spaces in the name. Notice how it delimits the path with backticks. Use the same character when you're typing. On my en-GB keyboard it is the character to the left of the 1 key.

Edit: ugh! my eyes! It's an apostrophe, not a backtick.


You can also use the ProgramFiles environment variable

cd $env:ProgramFiles

Tags:

Powershell