I have a batch file that will run several other file (lets call it procedure file) such as .bat,.exe,.py, etc...
if Not Exist JobStreamUnitTest_CreateTextPyt
I have found some issues in start /WAIT /B any_program || exit %errorlevel%
:
||
conditional command execution: unfortunately I can't document it properly, but all my attempts with it failed in relation to start
command...IMHO next code snippet (the only example) could work as expected:
if Not Exist JobStreamUnitTest_CreateTextBatch_4-27-2015.txt (
start /B /WAIT C:\Users\blee2\Documents\UnitTest\CreateNewFile.bat
SETLOCAL enabledelayedexpansion
if !errorlevel! NEQ 0 exit !errorlevel!
ENDLOCAL
copy /y nul JobStreamUnitTest_CreateTextBatch_4-27-2015.txt
)
start
command. start /WAIT /B
doesn't work (the /wait argument is ignored):
==>start /WAIT /B wmic OS GET Caption & echo xxx
xxx
==>Caption
Microsoft Windows 8.1
There's a simple workaround (from SupeUser) as start /B /WAIT
works:
==>start /B /WAIT wmic OS GET Caption & echo xxx
Caption
Microsoft Windows 8.1
xxx