vkill'blog

“技术本身没有太多价值,掌握了新的思考方式才是真的收获”

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

21:25 , vkill

::监视系统进程,防止病毒假冒,用路径的方式来判断
@echo off&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

Last modified by vkill on2007/12/10 22:00
类别:cmd script | Tags: , , | 0 条评论, 1313 次阅读
网友评论(0):
发表评论:

Nickname: 
Email:
Site URI: