Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At the cmd command prompt, this command will take me to my home directory:

cd %UserProfile%

At the PowerShell command prompt, the same command produces this error:

Set-Location : Cannot find path 'C:\%UserProfile%' because it does not exist.
At line:1 char:3
+ cd <<<<  %UserProfile%
    + CategoryInfo          : ObjectNotFound: (C:\%UserProfile%:String) [Set-Location], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

What is the equivalent command in PowerShell?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

You can get to your home dir with:

cd $home

share|improve this answer
As an add-on to this answer, %UserProfile% does not literally translate to $home, and, instead, you should use the $env:UserProfile variable. – SpellingD Jul 19 '12 at 15:57

This shorthand is one of my favorites:

cd ~

You can also do:

cd ~\Deskt 

(Hit the Tab key to auto-complete, it works nicely when you are buried in some deep directory and need to copy something to Desktop or somewhere in your $HOME)

share|improve this answer
Nice, somehow I didn't know you could use ~ in PowerShell! – Nate Barbettini yesterday

Your Answer


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.