Steven Meier Posted December 4, 2006 Share Posted December 4, 2006 Hi, I am writing a little app to pass some varibles to an exe when it is run. I am new to scripting in autoit and have tried a few things but am getting stuck. The command line app runs froma a dos windows in windows 2003 server and looks like this EVAperf fnh <HOSTname> <username> <Password> -cont The -cont option leaves the dos windows open and updates continuously. I will cut the portions of script I have done. Basically I am trying to get the user to enter the hostname their name and password, which will be passed with the executable when run. GuiCtrlCreateLabel(" Login Account:", 10, 353) $Login = GUICtrlCreateInput ( " " , 90, 350, 80, 20, ) GuiCtrlCreateLabel(" Password:", 180, 353) $Password = GUICtrlCreateInput ( "" , 240, 350, 80, 20, $ES_PASSWORD ) GuiCtrlCreateLabel(" Friendly Name Host::", 10, 320) $FNH = GUICtrlCreateInput ( "" , 110, 318, 80, 20 ) I am using a case statement as the gui has little buttons with different options and each button runs various scripts etc. Select Case $msg[0] = $App1 RunWait("C:\Program Files\Hewlett-Packard\EVA Performance Monitor\evaperf fnh" & GUICtrlRead($FNH) & GUICtrlRead($Login) & GUICtrlRead($Password)) In the above version I tried the gui read but have tried a few other ideas to no avail. Any guidance would be great Cheers Steve Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted December 4, 2006 Moderators Share Posted December 4, 2006 This should get you going in the right direction. #include <GuiConstants.au3> GUICreate("Test") GUICtrlCreateLabel(" Login Account:", 10, 353) $Login = GUICtrlCreateInput(" ", 90, 350, 80, 20) GUICtrlCreateLabel(" Password:", 180, 353) $Password = GUICtrlCreateInput("", 240, 350, 80, 20, $ES_PASSWORD) GUICtrlCreateLabel(" Friendly Name Host::", 10, 320) $FNH = GUICtrlCreateInput("", 110, 318, 80, 20) $App1 = GUICtrlCreateButton("App1", 10, 10) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $App1 $sHostName = GUICtrlRead($FNH) $sLogin = GUICtrlRead($Login) $sPassword = GUICtrlRead($Password) $sPath = @ProgramFilesDir & "\Hewlett-Packard\EVA Performance Monitor\evaperf fnh" If $sHostName And $sLogin And $sPassword Then RunWait($sPath & " " & $sHostName & " " & $sLogin & " " & $sPassword) Else MsgBox(48, "Error", "You must provide all required information.") EndIf Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Link to comment Share on other sites More sharing options...
Steven Meier Posted December 4, 2006 Author Share Posted December 4, 2006 Thanks I will give this a go. Much appreciated. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted December 5, 2006 Moderators Share Posted December 5, 2006 No problem, let us know if you have any more questions. 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