执行程序
call ssjc()
sub ssjc()
dim sj(15)
sj(0)="cmd.exe"
sj(1)="SecureCRT.exe"
sj(2)="360chrome.exe"
sj(3)="360MobileMgr.exe"
sj(4)="chrome.exe"
sj(5)="notepad++.exe"
sj(6)="notepad.exe"
sj(7)="Foxmail.exe"
sj(8)="java.exe"
sj(9)="dllhost.exe"
sj(10)="Fiddler.exe"
for i=0 to ubound(sj)
sjj=sj(i)
if sjj<>"" then
'KillProc(sjj)
killpdsfhy(sjj)
end if
next
end sub
'判断是否含有进程
function killpdsfhy(killhy)
On Error Resume Next
Dim WMI,objs,pdzj
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_Process")
For Each obj In objs
if obj.Description = killhy then
KillProc(killhy)
end if
Next
end function
'杀死进程
Function KillProc(strProcName)
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set arrProcesses = objWMIService.ExecQuery( "select * from win32_process where Name ='"&strProcName&"'" )
For Each proccess In arrProcesses
proccess.Terminate 0
Next
End Function