windows - Difference between "%~dp0" and ".\"? -
let's i'm using batch file , want direct folder located in same directory of batch. if i'm not wrong write "%~dp0\whateverfoldername". can't same done writing ".\whateverfoldername"? if so, difference and/or advantage of respective command?
pushd %~dp0
is used change original directory batch started. useful in newer os's when user may 'run administrator' changes current directory you! try sometime. make simple bat
@echo off echo.cd=%cd% pushd %~dp0 echo.cd=%cd% pause
now run it. run again 'as administrator' on vista, win 7, win 8, 2008 server, or 2012 server. see happens?
Comments
Post a Comment