Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows命令行:启动/等待写字板_Windows_Command Line - Fatal编程技术网

Windows命令行:启动/等待写字板

Windows命令行:启动/等待写字板,windows,command-line,Windows,Command Line,嗨,当我运行下面的BAT文件时,它不会等待写字板终止。记事本立即启动。我怎样才能让它等待?我使用的是64位Windows7 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

嗨,当我运行下面的BAT文件时,它不会等待写字板终止。记事本立即启动。我怎样才能让它等待?我使用的是64位Windows7

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
一个完美的问题

在我的系统(也是Windows 7)上,write.exe实际上启动了wordpad.exe进程,然后退出。由于“开始/等待”仅等待write.exe,因此write.exe退出后它将返回


如果您执行“start/wait wordpad.exe…”,它确实应该等到wordpad退出。

start/wait notepad&&start wordpad

我认为这与wordpad有关。我用iexplore更换了写字板,现在工作正常。你能解释一下为什么这会有帮助吗!?