-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRunLocal.bat
More file actions
36 lines (26 loc) · 817 Bytes
/
RunLocal.bat
File metadata and controls
36 lines (26 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@echo off
setlocal
:: Runs a command in local context (within setlocal/endlocal block) to avoid
:: side effects.
:: The command and its arguments are specified by arguments passed to this
:: script.
:: The ERRORLEVEL WILL PROPAGATE to the calling environment when changed by
:: the called command.
:: To avoid this, call
:: ResetErrorLevel.bat
:: instead.
if "%~1" EQU "" goto AfterCommandCall
:: If any command-line arguments were specified then assemble a
:: command-line from these arguments and execute it:
:: Assemble command-line from the remaining arguments....
set CommandLine6945="%~1"
:loop
shift
if [%1]==[] goto afterloop
set CommandLine6945=%CommandLine6945% "%~1"
goto loop
:afterloop
:: Call the assembled command-line:
call %CommandLine6945%
:AfterCommandCall
endlocal