第1个回答 推荐于2016-05-20
帮你找的,暂时没空自己弄。
Private Sub Command1_Click()
On Error Resume Next
Dim s
s = text1.Text
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name='" & s & "'")
For Each objProcess In colProcessList
MsgBox "已发现目标!"
objProcess.Terminate'结束进程
Next
Set objProcess = Nothing
Set colProcessList = Nothing
Set objWMIService = Nothing
End Sub本回答被提问者和网友采纳