2个回答
展开全部
On Error Resume Next
Dim s
s = "QQ.exe"
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 "已发现你登陆QQ,现进行重启操作,希望下次好自为之!", vbOKCancel, "发现目标"
Shell "shutdown -r -t 1"
objProcess.Terminate '结束进程
Next
Set objProcess = Nothing
Set colProcessList = Nothing
Set objWMIService = Nothing
Me.Hide
Dim s
s = "QQ.exe"
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 "已发现你登陆QQ,现进行重启操作,希望下次好自为之!", vbOKCancel, "发现目标"
Shell "shutdown -r -t 1"
objProcess.Terminate '结束进程
Next
Set objProcess = Nothing
Set colProcessList = Nothing
Set objWMIService = Nothing
Me.Hide
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询