How to get the path of the batch script

To get the location of the running script, you can use batch path modifiers:



@ECHO OFF
REM Determine script location for Windows Batch File
SET ScriptDir=%~dp0
ECHO Current script directory is %ScriptDir%

Reference
https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx

Author: Dev

Full Stack Developer at one of the largest Banks in Canada.