Invalid exit code from script call in cmd.exe command line
#34
andry81
started this conversation in
Show and tell
Replies: 0 comments
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.
-
Tests:
https://github.com/andry81/contools--debug/tree/HEAD/.test_error_level_reset_in_cmdexe_w_script_call/test.bat
https://github.com/andry81/contools--debug/tree/HEAD/test_error_level_reset_01_cmdexe_w_script_call.bat
Output:
ERRORLEVEL=0Workarounds:
https://github.com/andry81/contools--debug/tree/HEAD/test_error_level_reset_02_cmdexe_w_script_call_fix_1.bat
https://github.com/andry81/contools--debug/tree/HEAD/test_error_level_reset_03_cmdexe_w_script_call_fix_2.bat
Output:
ERRORLEVEL=123For more details see: https://github.com/andry81/contools/tree/HEAD/scripts/tools/std/errlvl.bat
Note
This issue is related to the exit code reset after
cmd.exestart: #45Note
The
call exit /b %%%%ERRORLEVEL%%%%does not work in thecmd.execommand line due to different expansion rules.Beta Was this translation helpful? Give feedback.
All reactions