Jump to content
Sign in to follow this  
tommytx

How to send a variable to the runwait receiver exe file..

Recommended Posts

tommytx

I am using the following RunWait command to activate an exe file and I need to get a variable into the exe program to use when running..

RunWait("image\PI_get.exe")

Can someone help me out with this....

RunWait("image\PI_get.exe?var=ht123")

For example i am trying to send something like ht123 to the exec file... and then how do I capture it in the exec file to make it ready for use...

I suppose its done via the command line somehow...

Thanks

Share this post


Link to post
Share on other sites
lark

I don't know about runWait, but look at ShellExecuteWait in the help file. You can pass in parameters using that function. Then look at the Command Line Parameters in the help file to see how access the parameter in your other program.

Share this post


Link to post
Share on other sites
tommytx

I can see how ShellExecuteWait allows command line parameters, but my problem is I don't know how to tell my compiled autoit exec file how to scan the command line to grab the parameters sent by the shell execute wait..

Share this post


Link to post
Share on other sites
lark

Under Command Line Parameters in the helpfile:

"The special array $CmdLine is initialized with the command line parameters passed in to your AutoIt script."

there is more information there. but in your executable file, $CmdLine[1] is the data that was passed into the program.

edit:

so in program one, you can run

ShellExecuteWait("imagePI_get.exe", "ht123")

and in the second one:

Global $sInput = $CmdLine[1]
Edited by mischieftoo

Share this post


Link to post
Share on other sites
MPHillier

what are the command line parameters for the .exe file you're wanting to use?

Here is an example of passing parameters to Xcopy -

RunWait("xcopy.exe " & $CopySingle_From & " " & "\\" & $Read_Single_Input & "\C$\" & $CopySingle_To & " " & "/O /H /R /K /I /X /Y", "", @SW_HIDE)

copies file from computer to computer and does not show the command while running...

Gives you any idea concerning your project?


I Break and Fix things... If the surf is up I'm outta here.....

Share this post


Link to post
Share on other sites
tommytx

Thanks I am good to go now... reading the two help file contents Mischieftoo suggested gave me all the information that I needed.... I am on a roll...

Share this post


Link to post
Share on other sites
lark

actually, that is apparently not the best way. look at jos' post i would imagine that you can use multiple parameters with that method, but i haven't tried.

edit: why did i not notice that MPHillier had posted? in any case, i was simply referring to my own method not being the best. the method MPHillier and jos have posted about seems to be the same, or at least similar.

Edited by mischieftoo

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  

×