本帖最后由 batman 于 2013-1-22 21:58 编辑
- '结束qq并禁止qq运行
- Dim objWMI, objEvents, objEvent
- Set objWMI = GetObject("Winmgmts:\\.\Root\Cimv2")
- Set objEvents = objWMI.ExecNotifiCationQuery _
- ("Select * From __InstanceOperationEvent Within 5 " _
- & "Where TargetInstance Isa 'Win32_Process'")
- Dim objItems, objItem
- Set objItems = objWMI.ExecQuery _
- ("Select * From Win32_Process Where Name='qq.exe'")
- For Each objItem In objItems
- objItem.Terminate
- Next
- Do While True
- Set objEvent = objEvents.NextEvent()
- If LCase(objEvent.TargetInstance.Name) = "qq.exe" Then
- If objEvent.Path_.Class = "__InstanceCreationEvent" _
- Then objEvent.TargetInstance.Terminate
- End If
- Loop
复制代码
|