When I run a batch file that lies in C:\some\dir
I know I can use %cd%
and %~dp0
to get the path of the batch file itself and other information as described here.
But I have not managed to get the "present working directory" after the batch file has executed a couple of cd
commands.
So for example:
- Batch file is in
C:\some\dir
- Batch file executes
cd sub
and latercd sub2
How would I get the path to that folder?
It should yield C:\some\dir\sub\sub2
and would be the equivalent of pwd
command when doing all of the above manually in the command line!
I had no luck with any of the commands above! It says here the %cd%
variable is supposed to update after cd
commands are used, but I always get C:\some\dir
as output.
EDIT