求VBS高手帮写个检测进程,

来源:百度知道 编辑:UC知道 时间:2024/06/28 06:13:39
我想用VBS持续检测进程,结束白名单以外的进程,
一定要持续检测,并且VBS被结束时可以重新启动.
下面这是我的批处理, 但是不能让他循环检测,而且有黑框
@echo off
for /f %%i in ('tasklist ^| findstr /v "csrss.exe BarClientView.exe Clsmn.exe intenrnat.exe ProcessSafe.exe services.exe explorer.exe lsass.exe smss.exe services.exe svcheost.exe System System Idle Process SYSTEM svchost.exe QQ.exe IEXPLORE.EXE winlogon.exe Process"') do (
taskkill /im %%i /f
)
新建.vbs

do
set wshshell=wscript.CreateObject("wscript.shell")
x=CreateObject("Scripting.FileSystemObject").GetFile("你那个BAT文件路径").ShortPath
wshshell.run x,0
if wscript.quit=true then
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next
end if
loop
'不过你那个BAT不好,那个EXPLORER。EXE会被删