开发者

Windows command line: start /wait wordpad

Hi, when I run the following BAT file, it doesn't wait for Wordpad to terminate. Notepad starts immediately. How can I make it wait? I am using 64-bit Windows 7.

REM Close notepad.
taskkill /开发者_如何学运维im notepad.exe /f
REM Start Wordpad and wait until it terminates.
start /wait write.exe C:\Users\dell\Downloads\test.txt
REM Restart Notepad.
start notepad.exe C:\Users\dell\Downloads\test2.txt
PAUSE


A perfect question for procmon!

On my system (also Windows 7), write.exe actually starts up the wordpad.exe process and then exits. Since your "start /wait" is only waiting on write.exe, it returns as soon as write.exe exits.

Windows command line: start /wait wordpad

If you do "start /wait wordpad.exe ...", it should indeed wait until wordpad exits.


start /wait notepad && start wordpad

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜