[英]Windows command line: start /wait wordpad
嗨,當我運行以下BAT文件時,它不會等待Wordpad終止。 記事本立即啟動。 我怎么能讓它等待? 我使用的是64位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
對於一個完美的問題莫過於procmon !
在我的系統(也是Windows 7)上,write.exe實際上啟動了wordpad.exe進程,然后退出。 由於您的“開始/等待”僅在write.exe上等待,因此只要write.exe退出就會返回。
如果你“開始/等待wordpad.exe ...”,它應該等到wordpad退出。
開始/等待記事本&&啟動wordpad
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.