使用这个脚本,可以随时让它歇下来。当然也可以让它继续工作。
前提是,你必须是本机管理员。
这个脚本使用一各很过时的终止程序方法:ntsd.exe -c q -p ProcessID。所以以前有过一个bat版,之所以用VBS是因为效率高一点,而且没有太多的黑色窗口。
主要思想是:循环终止程序+停止服务
代码如下:
' 程序初始化,取得参数
If WScript.Arguments.Count = 0 Then
Call main()
WScript.Quit
Else
Dim strArg, arrTmp
For Each strArg In WScript.Arguments
arrTmp = Split(strArg, "=")
If UBound( arrTmp ) = 1 Then
Select Case LCase( arrTmp(0) )
Case "sep"
Call sep( arrTmp(1) )
Case "process_stop"
Call process_stop( arrTmp(1) )
Case "process_start"
Call process_start( arrTmp(1) )
Case "server_stop"
Call server_stop( arrTmp(1) )
Case "server_start"
Call server_start( arrTmp(1) )
Case "show_tip"
Call show_tip( arrTmp(1) )
Case Else
WScript.Quit
End Select
End If
Next
WScript.Quit
End If
' 主程序
Sub main()
If (IsRun("Rtvscan.exe", "") = 1) Or (IsRun("ccSvcHst.exe", "") = 1) Or (IsRun("SMC.exe", "") = 1) Then
Call SEP_STOP()
Else
Call SEP_START()
End If
End Sub
' 带参数运行
Sub sep( strMode )
Select Case LCase(strMode)
Case "stop"
Call SEP_STOP()
Case "start"
Call SEP_START()
End Select
End Sub
' 停止SEP
Sub SEP_STOP()
Set wso = CreateObject("WScript.Shell")
'kill other app
Call process_clear()
'kill sep
wso.Run """" & WScript.ScriptFullName & """ server_stop=""SENS""", 0, True
'Get Me PID
Set pid = Getobject("winmgmts:\\.").InstancesOf("Win32_Process")
For Each id In pid
If LCase(id.name) = LCase("Wscript.exe") Then
mepid=id.ProcessID
End If
Next
'tips
wso.Run """" & WScript.ScriptFullName & """ show_tip=stop", 0, False
'stop service
wso.Run """" & WScript.ScriptFullName & """ server_stop=""SENS""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_stop=""Symantec AntiVirus""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_stop=""ccEvtMgr""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_stop=""SmcService""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_stop=""SNAC""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_stop=""ccSetMgr""", 0, True
'kill apps
wso.Run """" & WScript.ScriptFullName & """ process_stop=ccApp.exe", 0, False
wso.Run """" & WScript.ScriptFullName & """ process_stop=ccSvcHst.exe", 0, False
wso.Run """" & WScript.ScriptFullName & """ process_stop=SNAC.exe", 0, False
wso.Run """" & WScript.ScriptFullName & """ process_stop=Rtvscan.exe", 0, False
wso.Run """" & WScript.ScriptFullName & """ process_stop=SescLU.exe", 0, False
wso.Run """" & WScript.ScriptFullName & """ process_stop=Smc.exe", 0, False
wso.Run """" & WScript.ScriptFullName & """ process_stop=SmcGui.exe", 0, False
'wait
WScript.Sleep 15000
'kill other script
Set pid = Getobject("winmgmts:\\.").InstancesOf("Win32_Process")
For Each ps In pid
If (LCase(ps.name) = "wscript.exe") Or (LCase(ps.name) = "cscript.exe") Then ps.terminate
Next
'kill other app
Call process_clear()
'start ?
'Call SEP_START()
End Sub
' 恢复SEP
Sub SEP_START()
Set wso = CreateObject("WScript.Shell")
'tips
wso.Run """" & WScript.ScriptFullName & """ show_tip=start", 0, False
'start server
wso.Run """" & WScript.ScriptFullName & """ server_stop=""SENS""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_start=""Symantec AntiVirus""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_start=""ccEvtMgr""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_start=""SmcService""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_start=""SNAC""", 0, True
wso.Run """" & WScript.ScriptFullName & """ server_start=""ccSetMgr""", 0, True
Set wso = Nothing
End Sub
' 关闭进程
Function process_stop( strAppName )
Dim i
For i = 1 To 100
Set pid = Getobject("winmgmts:\\.").InstancesOf("Win32_Process")
&

