求VBS高手帮写个检测进程,
我想用VBS持续检测进程,结束白名单以外的进程,一定要持续检测,并且VBS被结束时可以重新启动.下面这是我的批处理,但是不能让他循环检测,而且有黑框@echoofffor...
我想用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 展开
一定要持续检测,并且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 展开
1个回答
展开全部
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会被删
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会被删
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询