Jump to content

Send&Receive Parameters to&in AU3 EXE


Recommended Posts

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

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
Link to comment
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
Link to comment
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
Link to comment
Share on other sites

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

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...