cmd检测程序是否启动
rem 通过/fo csv可以显示完整的映像名称
@echo off
setlocal enabledelayedexpansion
set serviceExe=test.exe
for /l %%i in (1,1,5) do (
set isStart=false
tasklist /fo csv | findstr %serviceExe% && set isStart=true
echo !isstart!
if !isStart!==true (
echo isstart
taskkill /f /im test.exe
timeout 5
) else (
echo nostart
goto end
)
)
:end
echo end
留待后查,同时方便他人
联系我:renhanlinbsl@163.com
联系我:renhanlinbsl@163.com