Created
August 17, 2013 14:14
-
-
Save jpluimers/6257059 to your computer and use it in GitHub Desktop.
Batch file to get parent directory without need of intermediate environment variables (so no need for setlocal as it is a one-liner)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo batchfile=%0 | |
echo full=%~f0 | |
setlocal | |
for %%d in (%~dp0.) do set Directory=%%~fd | |
echo Directory=%Directory% | |
for %%d in (%~dp0..) do set ParentDirectory=%%~fd | |
echo ParentDirectory=%ParentDirectory% | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I perform this,