Ptrck's 'Don't Forget How To' Blog
Wednesday, January 12, 2011
SET Curent path in a DOS BATCH file
If you want to know where the batch file lives: %~dp0
%0 is the name of the batch file. ~dp gives you the drive and path of the specified argument.
or
@echo off
SET currentpath = %~d0%~p0
echo %currentpath%
pause
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment