
【已解決】請幫忙優化下一個后臺結束P2P進程的批處理謝謝問題已解決目的:幫助客戶在退出PPS之類的P2P軟件后,自動結束相應的后臺進程。 例如:快播主程序為QvodPlayer.exe,后臺P2P進程為QvodTerminal.exe,如果客戶在看快播,則不結束任何進程,如果檢測到QvodPlayer.exe不存在,則結束QvodTerminal.exe。在后臺間隔一段時間反復循環檢測。要求::1:越節省系統資源越好 2:可方便增加新P2P軟件進程。其實,網上有個P2P后臺終結者,但是不能增加新P2P軟件進程,還有一個可以進程列表,但是一次性運行,不能后臺實時監控。特做此BAT。謝謝大家,代碼如下:
nclick="copycode($('code0'));">復制代碼
- @echo off
- if %1 == h goto begin
- mshta vbscript:createobject(wscript.shell).run(%~nx0 h,0)(window.close)&&exit
- :begin
- ping /n 3 127.0.1>nul
- :001
- REM 檢測PPS后臺進程
- tasklist /nh| find /i PPStream.exe
- if %ERRORLEVEL%==0 goto 002
- tasklist /nh| find /i PPSAP.exe
- if ERRORLEVEL 1 goto 002
- taskkill /F /IM PPSAP.exe
- taskkill /F /IM PPSKernel.exe
- ping /n 3 127.0.1>nul
- :002
- REM 檢測PPTV后臺進程
- tasklist /nh| find /i PPLive.exe
- if %ERRORLEVEL%==0 goto 003
- tasklist /nh| find /i PPAP.exe
- if ERRORLEVEL 1 goto 003
- taskkill /F /IM PPAP.exe
- ping /n 3 127.0.1>nul
- :003
- REM 檢測快播后臺進程
- tasklist /nh| find /i QvodPlayer.exe
- if %ERRORLEVEL%==0 goto 004
- tasklist /nh| find /i QvodTerminal.exe
- if ERRORLEVEL 1 goto 004
- taskkill /F /IM QvodTerminal.exe
- ping /n 3 127.0.1>nul
- :004
- REM 檢測風行后臺進程
- tasklist /nh| find /i Funshion.exe
- if %ERRORLEVEL%==0 goto 005
- tasklist /nh| find /i FunshionService.exe
- if ERRORLEVEL 1 goto 005
- taskkill /F /IM FunshionService.exe
- ping /n 3 127.0.1>nul
- :005
- REM 檢測迅雷看看后臺進程
- tasklist /nh| find /i XMP.exe
- if %ERRORLEVEL%==0 goto 006
- tasklist /nh| find /i ThunerService.exe
- if ERRORLEVEL 1 goto 006
- taskkill /F /IM ThunerService.exe
- ping /n 3 127.0.1>nul
- :006
- REM 檢測百度影音后臺進程
- tasklist /nh| find /i BaiduPlayer.exe
- if %ERRORLEVEL%==0 goto 007
- tasklist /nh| find /i BaiduP2PService.exe
- if ERRORLEVEL 1 goto 007
- taskkill /F /IM BaiduP2PService.exe
- ping /n 3 127.0.1>nul
- :007
- REM 檢測QQ直播后臺進程
- tasklist /nh| find /i QQLive.exe
- if %ERRORLEVEL%==0 goto 008
- tasklist /nh| find /i QQLiveExternal.exe
- if ERRORLEVEL 1 goto 008
- taskkill /F /IM QQLiveExternal.exe
- ping /n 3 127.0.1>nul
- :008
- echo 30秒后再次循環檢測
- ping /n 30 127.0.1>nul
- goto 001

