Sign in to follow this  
Followers 0
xenozarius

Pass 2 variables to a function that runs setup.exe

4 posts in this topic

Hello,

I'm fairly new to AutoIT and have had the chance to read over these forums and even the help files, but I'm still a lost soul and require some assistance. I'm using AutoIT to perform a regread of two values and then pop up a message box if those values are not present in the registry. The code there is very simple and the script I've been using up until now works just fine. Recently I discovered that the program I'm installing contains some setup parameters, and will insert those parameters into either the HKLM\SOFTWARE or HKLM\WOW6432NODE\SOFTWARE hives based on which OS Flavor I'm installing to.

What I'm failing to figure out how to do, even after reading tons of code examples and even searching the help files for CMDLine parameters is as follows.

I need to take the values of the regread or manually entered numbers and pass them to the setup.exe string. The code looks something like this:

.\setup.exe -compname (FirstVariable) -CompDesc (SecondVariable) -s -ni

Both the first and second variable would come from the regread performed in the beginning of the script. They only contain numbers and I want to pass them into the function call that runs my setup.exe.

Any examples or even words I can search for that would lead me to better examples is greatly appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Unless I've misunderstood your post, it sounds like you just need a simple Run() function.

Run(@ScriptDir & "\setup.exe -compname " & $var1 & " -CompDesc " & $var2 & " -s -ni")
Edited by rabbitkillrun2

Share this post


Link to post
Share on other sites

Unless I've misunderstood your post, it sounds like you just need a simple Run() function.

Run(@ScriptDir & "\setup.exe -compname " & $var1 & " -CompDesc " & $var2 & " -s -ni")

Thank you for the quick reply rabbitkillrun2,

I'm sorry I didn't include my current script, but it was very similar except for the Quotes and the ampersand around the $varX entries. The Run function was there, I was simply having issues figuring out how to pass those variables into the Run Function. Using your example, I'll try to compile my script again and see if I get better results.

Share this post


Link to post
Share on other sites

@Rabbitkillrun2

Your example worked like a champ. I had simply forgotten to include those Quotes and Ampersands. Thanks again for the assistance :)

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