このコマンドを使用するには、新しいテキストを .bat 形式で直接作成します。次に、次のコードをテキストに貼り付け、ダブルクリックして実行します。
PS:使用するときは、括弧と括弧のテキストコンテンツを忘れずに削除してください
@echo off & title 监测进程By Garcia
:start
cls
tasklist|find /i "chrome.exe" (进程的exe文件名)
if %errorlevel%==0 goto runff
if %errorlevel%==1 echo 没有找到该进程正在准备重启中...&goto open
:runff
ping 127.0.0.1 -n 5 (5秒执行一次)
echo 进程正常运行中!&goto start
:open
start /d "C:\Program Files\Google\Chrome\Application\" chrome.exe (需要运行的exe路径)
goto start