Created
February 9, 2017 16:53
-
-
Save phizaz/959cf9562f8c003de2490490c9e92db8 to your computer and use it in GitHub Desktop.
Batch script that escapes %cd% and %home% by using ${cd} and ${home} instead
This file contains hidden or 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 off | |
REM run command by parsing ${cd} to %cd% and ${home} to %home% | |
setlocal ENABLEDELAYEDEXPANSION | |
set str=%* | |
set str=!str:${cd}=%CD%! | |
set str=!str:${home}=%HOME%! | |
REM run the parsed command | |
%str% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment