Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted (edited)

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
Posted

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

Posted

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

Posted (edited)

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...