Jump to content

Passing Data upon call to launch .exe


 Share

Recommended Posts

Hello;

I am a noobie,1st post for me on this forum and not really great with code.

I have an outside application that will make a call to an .exe (that I am creating) on the local machine and pass some data with the call.

for instance

c:\application.exe /data1 /data2

I then want to be able to take the data and act on it after the program launches.

Any Ideas?

Thanks Much!!

Link to comment
Share on other sites

There's a built-in variable called $cmdLine that you can use. It's an array variable, so $cmdLine[0] will tell you how many parameters were passed to the autoit exe with the 'space' character being the delimeter between commands.

In your case:

$cmdLine[0] = 2

$cmdLine[1] = "/data1"

$cmdLine[2] = "/data2"

Link to comment
Share on other sites

Ok guys (gals?), I have run ito a small issue that I am sure someone will be able to come up with a solution for. I have tried the help file for about an hour now trying to figure a way to accomplish this but figured instead of wasting a day to ask the group.

The command above is working for me and now I can see how the extra parameters are being passed from the outside application. The problem is that instead of a space between data1 and data2 there is a comma seperating them. My job would be easy if I could get the outside app to pass the qualifiers with a space but they are not able. I want to end up with 2 variables. Variable1 = data1, variable2 = data2

Any ideas?

Thanks again!

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