大概思路
每个5秒钟去查询进程中是否存在某进程,存在则执行其他程序,否则等待
具体代码可参照:
set status=false
:TaskXXX
for /f "delims= " %%i in ('tasklist') do (
if "%%i"=="TaskXXX.exe" (set status=true)
)if "%status%"=="true" (
start iexplore http://127.0.0.1 ) else (
ping -n 5 127.0.0.1>nul goto TaskXXX
)
标签:status,bat,set,%%,程序,TaskXXX,0.1,127.0,某个
From: https://blog.51cto.com/u_7457870/7110030