Directory path of the executed batch file

There are batch files that you put in your environment variables(e.g. PATH) folder so that you can execute them anywhere. However, to know where the batch files were executed, here is the code:

SET BATCH_HOME=%~dp0
ECHO.%BATCH_HOME%