JohnBailey Posted August 16, 2007 Share Posted August 16, 2007 Guys\Gals, I just don't know how to send parameters to a AU3 exe and then have it receive the parameters. How do I do this? I'm just looking for some good nudges in the right direction. I'm searching around and coming up dry. A decision is a powerful thing Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 btw, I've seen ShellExecute(). However, I don't know how to get a AU3 to receive info using this. A decision is a powerful thing Link to comment Share on other sites More sharing options...
weaponx Posted August 16, 2007 Share Posted August 16, 2007 Per the help file: $CmdLine[0] is number of parameters $CmdLine[1] is param 1 (after the script name) $CmdLine[2] is param 2 etc Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 Per the help file: $CmdLine[0] is number of parameters $CmdLine[1] is param 1 (after the script name) $CmdLine[2] is param 2 etc that's it!! http://www.autoitscript.com/autoit3/docs/intro/running.htm thank you weaponx! A decision is a powerful thing Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 What is the syntax for sending multiple params? A decision is a powerful thing Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 16, 2007 Share Posted August 16, 2007 (edited) What is the syntax for sending multiple params? Sending them where? The command line is a long string, so if that's what you are talking about: $ParameterTwo = 'My param 2' $ParameterThree = 'LastParam' Run(@ScriptDir & '\MyAutoItScript.exe "Parameter One" "' & $ParameterTwo & '" "' & $ParameterThree & '"') When MyAutoItScript starts it will have: $CommandLine[0] = 3 $CommandLine[1] = 'Parameter One' $CommandLine[2] = 'My param 2' $CommandLine[3] = 'LastParam' Edit: Added more detail. Edited August 16, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
weaponx Posted August 16, 2007 Share Posted August 16, 2007 You mean like sending paramaters using Run()??? Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 Sorry guys... I wasn't clear. I mean in reference to ShellExecute. The manual (as far as I can tell) doesn't give an example or explain the syntax for sending multiple parameters with ShellExecute Example ShellExecute ( $SAILocSaiAutoItfolder&'Confirms - All.exe', '1,2' , $SAILocSaiAutoItfolder) 1 and 2 are the two parameters I want to send. Obviously comma is not the deliminator used. A decision is a powerful thing Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 Answer is & ' ' & so it's a space ShellExecute ( $SAILocSaiAutoItfolder&'Confirms - All.exe', 1& ' ' &2 , $SAILocSaiAutoItfolder) A decision is a powerful thing Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 16, 2007 Share Posted August 16, 2007 Sorry guys... I wasn't clear. I mean in reference to ShellExecute. The manual (as far as I can tell) doesn't give an example or explain the syntax for sending multiple parameters with ShellExecuteExampleShellExecute ( $SAILocSaiAutoItfolder&'Confirms - All.exe', '1,2' , $SAILocSaiAutoItfolder)1 and 2 are the two parameters I want to send. Obviously comma is not the deliminator used. The parameter are all one string, so just pass a single string formatted the same way you would type them in the Run box from Start. Ignoring the path for the moment -- If this would work from the Run box:"Confirms - All.exe" 1 2Then your ShellExecute would be:ShellExecute ('Confirms - All.exe', '1 2') Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 Thanks PsaltyDS Gosh, I can see this coming up --> How do I send multiple params that contain spaces. Example: Local $param1 = 'Jimmy Shi' Local $param2 = 'Three folds nine. Got them down.' ShellExecute ('Confirms - All.exe', $param1&' '&$param2) A decision is a powerful thing Link to comment Share on other sites More sharing options...
The Kandie Man Posted August 16, 2007 Share Posted August 16, 2007 (edited) Like this:Local $param1 = 'Jimmy Shi' Local $param2 = 'Three folds nine. Got them down.' Local $param3 = 'asdf!11' ShellExecute ('Confirms - All.exe', '"'& $param1 & '" "' & $param2 & '" "' & $param3 & '"') - The Kandie Man ;-) Edited August 16, 2007 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
JohnBailey Posted August 16, 2007 Author Share Posted August 16, 2007 ShellExecute ('Confirms - All.exe', '"'& $param1 & '" "' & $param2 & '" "' & $param3 & '"') SWEEEEEEEEEEEET!!! Ok, so encapsulate each param with double-quotations. A decision is a powerful thing 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