Link to home
Start Free TrialLog in
Avatar of manajitrath
manajitrath

asked on

how can i find the current working directory using batch files

how can i find the current working directory using batch files
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Easy one :-)

echo cd%

Steve
Or even
echo %cd%

ASKER CERTIFIED SOLUTION
Avatar of AmazingTech
AmazingTech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good point... and do similar when I need to pickup files from batch file dir. but the current working directory is the default directory used if you do, say, an unqualified dir, for instance.  Same as unix pwd.
I like AmazingTech's suggestions for getting the batch file path to pickup associated files from the same dir BUT %CD% IS the current working directory which is what the question asked. Period.  If you do "copy something.txt d:\somewherelse.txt" it will pick it up from the %cd% directory.  That's what working directory is.