Windows shell command to get the full path to the current directory?

user62958 picture user62958 · Mar 3, 2009 · Viewed 511k times · Source

Is there a Windows command line command that I can use to get the full path to the current working directory?

Also, how can I store this path inside a variable used in a batch file?

Answer

Trevor Bramble picture Trevor Bramble · Mar 3, 2009

Use cd with no arguments if you're using the shell directly, or %cd% if you want to use it in a batch file (it behaves like an environment variable).