判斷文件是否存在
if not EXIST "文件絕對路徑" goto exit
存在……
:exit
不存在
執行一個應用程序
start 應用程序名稱
start notepad.ext
執行另一個批處理
call a.bat
查找進程是否存在
tasklist /nh|find /i "QQa.exe"
if ERRORLEVEL 1 (echo qqa.exe不存在) else (echo qqa.exe存在)
tasklist | findstr /i botserver.exe
IF ERRORLEVEL 1 start /b botserver.exe
暫定 X 秒(非精確)
ping -n 2 -w 500 0.0.0.1>null
關閉進程
taskkill