16

Possible Duplicate:
Is there a short cut command in Windows command prompt to get to the current users home directory like there is in Linux?

Any short way to cd to the user specific directories in the command prompt. Like for e.g. in linux shell (debian based) we do a cd ~ and it instantly takes to the current logged user's directory /home/<username>. Anything to this effect on windows?

ps: currently trying to do this on xp machines. If it differs for other machines, mention that too.

deostroll
  • 1,795
  • 7
  • 24
  • 37

1 Answers1

26

The environment variable is called %userprofile% , which should work on most NT or newer machines.

As per James' comment if you're on another drive you would need to do cd /D %userprofile%, else cd %userprofile% will do.

Kevin Driedger
  • 2,875
  • 3
  • 21
  • 19
Journeyman Geek
  • 127,463
  • 52
  • 260
  • 430
  • 1
    If you are on a different drive to your user profile it wont change it for you, so you need to add the switch `/D` to `cd` to do this. – James Oct 18 '11 at 11:40
  • 1
    `cd %homepath%` seems to work, too – btwiuse May 04 '17 at 08:26
  • cd ~ will work fine on windows powershell, if you experience unsupported commands make sure you are using the correct terminal – sh.e.salh Sep 19 '22 at 15:00