检查进程是否存在
2011-01-05 13:39
232 查看
Function CheckApplicationIsRun(ByVal szExeFileName As String) As Boolean
On Error GoTo Err
Dim WMI
Dim Obj
Dim Objs
CheckApplicationIsRun = False
Set WMI = GetObject("WinMgmts:")
Set Objs = WMI.InstancesOf("Win32_Process")
For Each Obj In Objs
If InStr(UCase(szExeFileName), UCase(Obj.Description)) <> 0 Then
CheckApplicationIsRun = True
If Not Objs Is Nothing Then Set Objs = Nothing
If Not WMI Is Nothing Then Set WMI = Nothing
Exit Function
End If
Next
If Not Objs Is Nothing Then Set Objs = Nothing
If Not WMI Is Nothing Then Set WMI = Nothing
Exit Function
Err:
If Not Objs Is Nothing Then Set Objs = Nothing
If Not WMI Is Nothing Then Set WMI = Nothing
End Function
来源:http://hi.baidu.com/jjjjjjj/blog/item/c2672d733a776c198601b050.html
On Error GoTo Err
Dim WMI
Dim Obj
Dim Objs
CheckApplicationIsRun = False
Set WMI = GetObject("WinMgmts:")
Set Objs = WMI.InstancesOf("Win32_Process")
For Each Obj In Objs
If InStr(UCase(szExeFileName), UCase(Obj.Description)) <> 0 Then
CheckApplicationIsRun = True
If Not Objs Is Nothing Then Set Objs = Nothing
If Not WMI Is Nothing Then Set WMI = Nothing
Exit Function
End If
Next
If Not Objs Is Nothing Then Set Objs = Nothing
If Not WMI Is Nothing Then Set WMI = Nothing
Exit Function
Err:
If Not Objs Is Nothing Then Set Objs = Nothing
If Not WMI Is Nothing Then Set WMI = Nothing
End Function
来源:http://hi.baidu.com/jjjjjjj/blog/item/c2672d733a776c198601b050.html
相关文章推荐
- linux下php检查进程是否存在
- 在系统中检测指定的窗口是否已经打开,检查某进程是否存在
- 在系统中检测指定的窗口是否已经打开,检查某进程是否存在
- 检查进程是否存在
- 检查程序进程是否存在/强制杀掉程序进程
- Linux C语言检查进程是否存在
- 检查程序进程是否存在/强制杀掉程序进程
- centos 里 检查进程是否存在
- Windows中检查某一进程是否存在
- VB.Net检查进程是否存在及关闭进程
- 检查进程是否存在
- 利用脚本检查个进程是否存在
- 【API】检查进程是否存在 - CreateToolhelp32Snapshot
- 判断指定进程号的进程是否存在
- 循环10秒检测是否存在某进程
- 判断某进程是否存在
- 检查数组中是否存在某个值in_array(value,array,type)
- 定时检查进程存在情况
- 检查某目录或是文件是否存在 file_exists( ABSPATH . 'wp-config.php')
- redis 全局命令 查看所有的键,删除键,检查键是否存在,获取过期时间,键的数据结构类型