Sign in to follow this  
Followers 0
JohnBailey

Send&Receive Parameters to&in AU3 EXE

13 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

What is the syntax for sending multiple params?


A decision is a powerful thing

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 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

Share this post


Link to post
Share on other sites

You mean like sending paramaters using Run()???

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Answer is & ' ' &

so it's a space

ShellExecute ( $SAILocSaiAutoItfolder&'Confirms - All.exe', 1& ' ' &2  , $SAILocSaiAutoItfolder)

A decision is a powerful thing

Share this post


Link to post
Share on other sites

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.

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 2

Then 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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 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

Share this post


Link to post
Share on other sites

ShellExecute ('Confirms - All.exe', '"'& $param1 & '" "' & $param2 & '" "' & $param3 & '"')
SWEEEEEEEEEEEET!!! Ok, so encapsulate each param with double-quotations.

A decision is a powerful thing

Share this post


Link to post
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
Sign in to follow this  
Followers 0