Jump to content

Running command line with parameters


saldous
 Share

Recommended Posts

My script is using InputBoxes to ask the user for a number of things, email address, password etc..

I want to take these inputs and pass them to a command line install.

I've got these items defined the the InputBox inputs:

$email, $passwd

but my pass through to the command line isn't working.

My command line should look like this:

msiexec /qn /i program.msi EMAILADDRESS=$email PASSWORD=$passwd

I'm using the following code for it:

CODE
Run("msiexec /qn /i program.msi EMAILADDRESS=" & GUICtrlRead($email) & "PASSWORD=" & GUICtrlRead($passwd)")

But it isn't doing what I want, any ideas?

Thank you.

Edited by saldous
Link to comment
Share on other sites

MsgBox(0,0,"msiexec /qn /i program.msi EMAILADDRESS=" & GUICtrlRead($email) & " PASSWORD=" & GUICtrlRead($passwd))

Thanks, so the problem is that both $email and $passwd are returning values of "0" and not the real contents of them.

Going back to what I said earlier, I'm using InputBoxes here, rather than GUICtrlCreateEdit, does that make a difference? How do you read back in from an InputBox response?

Even the following simple code returns a "0" instead of the entered data:

CODE
; User enters email address

$email = InputBox("Install", "Please enter your email address", "", " M", _

400, -1)

If @error = 1 Then

MsgBox(4096, "", "Install Cancelled")

Exit

EndIf

MsgBox(0,0, GUICtrlRead($email))

Edited by saldous
Link to comment
Share on other sites

As simple as

; User enters email address
$email = InputBox("Install", "Please enter your email address", "", " M", _
400, -1)


If @error = 1 Then
MsgBox(4096, "", "Install Cancelled")
Exit
EndIf

MsgBox(0,0, $email)

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Link to comment
Share on other sites

Shevilie, you are a life saver! Thank you so much, my script is working perfectly now. So simple, I was over complicating it ! Everyone on these forums that has helped me has enabled me to complete my 1st script in just over 24 hours. AutoIT is excellent, I'm no programmer and I've managed to get something up and running in a very short time. Perfect!

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