批處理判斷進程是否存在並啓動進程啓動程序代碼

@echo off
tasklist | find /i "speedfan.exe"
if "%errorlevel%"=="1" (goto f) else (goto e)
:f
echo [ %time:~,-3% ]不存在進程speedfan.exe
start "" "D:\SpeedFan\speedfan.exe"
exit
:e
echo [ %time:~,-3% ]存在進程speedfan.exe
taskkill /f /im cmd.exeide

相關文章
相關標籤/搜索