判斷文件是否存在
if not EXIST "文件絕對(duì)路徑" goto exit
存在……
:exit
不存在
執(zhí)行一個(gè)應(yīng)用程序
start 應(yīng)用程序名稱
start notepad.ext
執(zhí)行另一個(gè)批處理
call a.bat
查找進(jìn)程是否存在
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
關(guān)閉進(jìn)程
taskkill