Windows Batch noop instruction
#41
andry81
started this conversation in
Show and tell
Replies: 1 comment
-
|
Additional feature is that the Tests:@echo off
setlocal
call;
rem requires to press CTRL+C because of infinite for loop
cmd.exe /c @for /L %%i in () do @break || call cmd.exe /c @if %%ERRORLEVEL%% EQU -1073741510 (exit 9009) else exit %%ERRORLEVEL%%
echo ERRORLEVEL=%ERRORLEVEL%If replace |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is exist a builtin instruction without
ERRORLEVELchange and without arguments. It can be used to concatenate command lines using&operator inside(...)blocks.Tests:
https://github.com/andry81/contools--debug/tree/HEAD/test_for_concat.bat
https://github.com/andry81/contools/tree/HEAD/scripts/tests/bench/bat/test__call/
Result:
Note
The
breakin thecmd.execommand line still can change the exit code: #46Note
The
breakdoes change the exit code onSIGINT: #48Beta Was this translation helpful? Give feedback.
All reactions