Sign in to follow this  
Followers 0
itctravel

Passing Data upon call to launch .exe

6 posts in this topic

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

Share this post


Link to post
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"

Share this post


Link to post
Share on other sites

Thanks Unicornasaurus!

I will try playing with that a bit. I am looking at this in the HELP file for more detail. I appreciate you taking the time to help, I think I should be able to make this work.

:idiot:

Share this post


Link to post
Share on other sites

It Works!!!

Thanks again to you and all on this forum that help turn coal to diamonds!

:ILA2:

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Hey Guys, with your help, I now completed my script and am very happy with the results. Thanks to all for your guidence!

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