Red-Steel Posted July 20, 2007 Share Posted July 20, 2007 Hello, I need to find the exe's path of a running exe file with the handle/pid of this file. Thanks! Link to comment Share on other sites More sharing options...
Sardith Posted July 20, 2007 Share Posted July 20, 2007 Can't remember who wrote this function, sorry that I cannot give credit where credit is due. Just had it in my files for aid in making a program. The function that your looking for: ;Gets Path via PID Func _WinGetPath($PID="") $colItems = "" $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE ProcessId = " & $PID, "WQL", _ 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems If $objItem.ExecutablePath Then Return $objItem.ExecutablePath Next EndIf EndFunc [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now