Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does pushd %~dp0 in .cmd file means? I understand %~dp0 means it indicates a drive letter [duplicate]

What does pushd %~dp0 in .cmd file means? I understand that %~dp0 means it indicates a drive letter. What does pushd indicate?.

like image 529
Maddy Avatar asked Sep 07 '17 06:09

Maddy


1 Answers

Save the current directory on a stack and change to %~dp0 which is the drive-and-path of the "0'th" command-line parameter (which is the command itself) so the destination path to be set is the drive/path of the batch file to be executed.

To return to the original path, you need a popd

like image 84
Magoo Avatar answered Nov 01 '22 00:11

Magoo