CALL command vs. START with /WAIT option

后端 未结 6 1931
孤城傲影
孤城傲影 2020-11-30 17:59

How is the START command with a WAIT option

START /wait notepad.exe 
START /wait  notepad.exe 

...any different from using a CALL command?

6条回答
  •  Happy的楠姐
    2020-11-30 19:03

    There is a useful difference between call and start /wait when calling regsvr32.exe /s for example, also referenced by Gary in in his answer to how-do-i-get-the-application-exit-code-from-a-windows-command-line

    call regsvr32.exe /s broken.dll
    echo %errorlevel%
    

    will always return 0 but

    start /wait regsvr32.exe /s broken.dll
    echo %errorlevel%
    

    will return the error level from regsvr32.exe

提交回复
热议问题