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