Faustvii Posted February 14, 2006 Posted February 14, 2006 hi i dont know if autoit is able to find a path to a running process lets say winlogon.exe then it should give you the path to the dir of the process does anybody know if autoit is able to do that? if yes can anyone give me an exsample ?
Infinitex0 Posted February 14, 2006 Posted February 14, 2006 (edited) Go to the helpfile and find macros probably one of them will do what you need (I just can't find it) Edited February 14, 2006 by Infinitex0 The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]
GaryFrost Posted February 14, 2006 Posted February 14, 2006 http://www.autoitscript.com/forum/index.ph...ndpost&p=113711 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Faustvii Posted February 14, 2006 Author Posted February 14, 2006 (edited) http://www.autoitscript.com/forum/index.ph...ndpost&p=113711Tyvm for that link.. How do i do so it only looks in winlogon.exe and not all the others? Edited February 14, 2006 by Liope
Moderators SmOke_N Posted February 14, 2006 Moderators Posted February 14, 2006 Here a stab at it, I only looked at larry's UDF... GetProcessName(ProcessExists(winlogon.exe)) 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.
ChrisL Posted February 15, 2006 Posted February 15, 2006 (edited) Used Scriptomatic to generate most of this, see if it will work for you Edit* Forgot to say you need the beta $Mypath = FindProcessPath ("WinLogOn") MsgBox (0,"Required Path is", $MyPath) Func FindProcessPath ($PIDName) $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $path = "ExecutablePath: " & $objItem.ExecutablePath $Name = "Name: " & $objItem.Name $Pid = "ProcessId: " & $objItem.ProcessId if StringinStr ($Name ,$PidName,0,1) <> 0 then Return StringTrimLeft ($Path, 16) Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Process" ) Endif EndFunc Edited February 15, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
JerryD Posted February 15, 2006 Posted February 15, 2006 I had posted a WMI solution for this - How to get full file name from PID, but Larry subsequently posted the link to his solution - Get Process Name From PID which uses DLLCall.I ran a quick test, and DLLCall is more than 10 times faster than using WMI, although when looping through all processes running. DLLCall did return a few errors, but it probably just needs a little tweaking, so if you're going to be using it a lot, I'd recommend using DLLCall rather than WMI.Guess Larry is king!
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