VBS随便改一下就能用在WEB上,只是要找他的类型比较麻烦,用object总是感觉不爽。
Dim WMI
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_Process")
For Each obj In objs
Enum1 = Enum1 + obj.Description + Chr(13) + Chr(10)
Next
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_Process")
For Each obj In objs
Enum1 = Enum1 + obj.Description + Chr(13) + Chr(10)
Next
Dim WMI As Object
WMI = GetObject("WinMgmts:")
Dim objs As Object = WMI.InstancesOf("Win32_Process")
Dim obj As Object
'列出进程
For Each obj In objs
Response.Write(obj.Description)
Response.Write("<P>")
Next
WMI = GetObject("WinMgmts:")
Dim objs As Object = WMI.InstancesOf("Win32_Process")
Dim obj As Object
'列出进程
For Each obj In objs
Response.Write(obj.Description)
Response.Write("<P>")
Next
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'QQ.exe'")
'终止QQ进程
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'QQ.exe'")
'终止QQ进程
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Dim strComputer As String = "."
Dim objWMIService As Object = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Dim colProcessList As Object = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'QQ.exe'")
Dim objProcess As Object
For Each objProcess In colProcessList
objProcess.Terminate()
Next
Dim objWMIService As Object = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Dim colProcessList As Object = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'QQ.exe'")
Dim objProcess As Object
For Each objProcess In colProcessList
objProcess.Terminate()
Next