xenozarius Posted June 25, 2011 Share Posted June 25, 2011 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. Link to comment Share on other sites More sharing options...
rabbitkillrun2 Posted June 25, 2011 Share Posted June 25, 2011 (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 June 25, 2011 by rabbitkillrun2 Link to comment Share on other sites More sharing options...
xenozarius Posted June 25, 2011 Author Share Posted June 25, 2011 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. Link to comment Share on other sites More sharing options...
xenozarius Posted June 25, 2011 Author Share Posted June 25, 2011 @Rabbitkillrun2 Your example worked like a champ. I had simply forgotten to include those Quotes and Ampersands. Thanks again for the assistance 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