用VBA来关闭其他程序
以关闭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
作者:laoyebin(Paladin.lao)
出处:http://www.cnblogs.com/laoyebin/
网赚 :https://laoyebin.com/
优惠码发布:https://yhmfb.com/
导读网:https://daodu.co/
外汇吧:https://waihui.pub/
本文版权归作者和博客园共有,欢迎转载,但请保留作者信息和原文链接,非常感谢。
反馈文章质量,你可以通过快速通道评论: