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?
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?
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).On Unix?
pwd
This has always worked for me:
Quote the Windows help for the
set
command (set /?
):Note the
%CD% - expands to the current directory string.
part.On Windows, type
cd
for the working current path.On Linux,
pwd
for the current working path.But, of course, gmaran23's answer is the much easier one.