以关闭Winrar.exe为例,代码如下:
Sub closeWinrar()
Dim oWMT As Object, oProcess As Object
Set oWMT = GetObject("winmgmts://")
For Each oProcess In oWMT.InstancesOf("Win32_Process")
If LCase(oProcess.Name) = "winrar.exe" Then
If oProcess.Terminate() = 0 Then Exit Sub
End If
Next
End Sub
转自 http://blog.youkuaiyun.com/laoyebin/article/details/5732682

3373

被折叠的 条评论
为什么被折叠?



