Jump to content

Path of process?


Recommended Posts

hi,

i would like to find out path of process... for example: i have process named "process.exe" and how can i find out which prog creates this process and what is the path to this prog? it is possible in AutoIt?

thanx

Link to comment
Share on other sites

I think, with a search, AutoIt could give you all the possible entries that may be the exe. I don't think Windows links the processes with pathnames..

might want to rethink that http://www.autoitscript.com/forum/index.ph...st&p=200047

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • Moderators

but for example sysinternals process explorer can find out the path of process... it is possible in autoit with dllcall or plugin (or something like that)?

Going to assume you didn't try Gary's code, and Larry has an option for it too somewhere.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

thanx a lot! i have adapt the script to my needs:

CODE

$title = WinGetTitle("winTitle...", "") ;first chars of full winTitle

$path = _WinGetPath($title) ;if process/win does not exists then return = 0

MsgBox(0, "Path of process", $path)

Func _WinGetPath($title, $strComputer='localhost')

$pid = WinGetProcess($title)

$wbemFlagReturnImmediately = 0x10

$wbemFlagForwardOnly = 0x20

$colItems = ""

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")

$colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE ProcessId = " & $pid, "WQL", _

$wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) Then

For $objItem In $colItems

If $objItem.ExecutablePath Then Return $objItem.ExecutablePath

Next

EndIf

EndFunc

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...