itctravel Posted September 6, 2012 Share Posted September 6, 2012 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 More sharing options...
Unicornasaurus Posted September 6, 2012 Share Posted September 6, 2012 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 More sharing options...
itctravel Posted September 7, 2012 Author Share Posted September 7, 2012 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. Link to comment Share on other sites More sharing options...
itctravel Posted September 7, 2012 Author Share Posted September 7, 2012 It Works!!! Thanks again to you and all on this forum that help turn coal to diamonds! Link to comment Share on other sites More sharing options...
itctravel Posted September 10, 2012 Author Share Posted September 10, 2012 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 More sharing options...
itctravel Posted September 12, 2012 Author Share Posted September 12, 2012 Hey Guys, with your help, I now completed my script and am very happy with the results. Thanks to all for your guidence! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now