当前位置:DOS资源站资料中心批处理教程 → 监视系统进程,防止病毒假冒,用路径的方式来判断

监视系统进程,防止病毒假冒,用路径的方式来判断

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-4-16 22:11:15

::监视系统进程,防止病毒假冒,用路径的方式来判断
@echo off&title DOS资源站 www.cmdos.net&endlocal&setlocal ENABLEDELAYEDEXPANSION
:loop
set "exePath=C:\WINDOWS\System32\smss.exe;C:\WINDOWS\system32\csrss.exe;"C:\Program Files\WinRAR\WinRAR.exe""
for %%? in (%exepath%) do (
  set "str=%%~?"
  wmic process where "name='%%~nx?' and executablePath<>'!str:\=\\!'" call terminate
                         )
ping -n 20 127.1 >nul 2>nul
goto :loop