MerkurAlex Posted January 5, 2009 Posted January 5, 2009 Is there any way to have a variable with the name of the executable that called your app? [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]
youknowwho4eva Posted January 5, 2009 Posted January 5, 2009 Is it an executable you made? Are you just trying to pass a variable from one program to another? Giggity
FireFox Posted January 5, 2009 Posted January 5, 2009 @youknowwho4eva He just want to build script wich now what program run it script for example AutoIt3.exe Cheers, FireFox.
monoceres Posted January 5, 2009 Posted January 5, 2009 Found this when googling:http://bytes.com/groups/net-vb/385638-how-...ent-process-pidI can take a look at the CreateToolhelp32Snapshot function later if you want to Broken link? PM me and I'll send you the file!
TurionAltec Posted January 5, 2009 Posted January 5, 2009 Try PsaltyDS's _ProcessListProperties()http://www.autoitscript.com/forum/index.php?showtopic=70538$array=_ProcessListProperties(@AutoItPID) $parentPID=$array[1][2]It takes ~half a second to compute, you might be able to cut down on some of the calls in the internal functions of _processlistproperties()
Developers Jos Posted January 5, 2009 Developers Posted January 5, 2009 - or something like - #include <Process.au3> $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $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 If @AutoItPID = $objItem.ProcessId Then MsgBox(0,'Parent program name',_ProcessGetName($objItem.ParentProcessId) ) EndIf Next Else MsgBox(0, "WMI Output", "No WMI Objects Found for class: " & "Win32_Process") EndIf SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
trancexx Posted January 5, 2009 Posted January 5, 2009 SmOke_N had successful code regarding this (not WMI).link ♡♡♡ . eMyvnE
MerkurAlex Posted January 5, 2009 Author Posted January 5, 2009 Thanks for writing the WMI code for me rofl and no if i were trying to pass a variable from one app to another that i made i would have used the command line or something thanks for posting guys! [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]
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