ai1118 發表於 2014-7-14 09:18:26

[VB] 無需 OpenProcess 取得進程檔案路徑

調用方式:MsgBox GetProPath("Explorer.exe")函數:Public Function GetProPath(ProName As String) As String
Dim objWMIService As Object
Dim colProcesslist As Object
Dim objProcess As Object
Set objWMIService = CreateObject("winmgmts:{impersonationLevel=Impersonate}!root\cimv2")
Set colProcesslist = objWMIService.ExecQuery("select * from win32_process where name=" & Chr(39) & ProName & Chr(39))
For Each objProcess In colProcesslist
GetProPath = objProcess.ExecutablePath
Next
End Function來源: knowlet3389.blogspot.tw

頁: [1]
查看完整版本: [VB] 無需 OpenProcess 取得進程檔案路徑