windows监控进程死亡并拉起

监控进程拉起

@echo off 
set xcmc1=PerfWndMonHelper.exe
set xcmc2=PerfWndMonHelper_x86.exe

:START_CHECK
tasklist | findstr "%xcmc1%" > nul || goto START1
tasklist | findstr "%xcmc2%" > nul || goto START2

ping -n 5 127.0.0.1 > nul
goto START_CHECK

:START1
@echo proc died, start PerfWndMonHelper
cd "C:\Program Files\Huawei\PCManager"
start PerfWndMonHelper.exe
goto START_CHECK

:START2
@echo proc died, start PerfWndMonHelper_x86
cd "C:\Program Files\Huawei\PCManager"
start PerfWndMonHelper_x86.exe
goto START_CHECK
posted @ 2022-06-08 15:14  mooooonlight  阅读(205)  评论(0编辑  收藏  举报