Ptec2 Posted June 13, 2011 Share Posted June 13, 2011 Hello to everyone in the community, I am happy to join the group. I am new to Autoit, and would like to help. I'm needing a script that is to run a. exe but she requests that the password for the call. exe and that validation is done after ex. 30 segundos after the password is entered, it would be something automatic, thank you all for any help or ideas. Thk. Ptec2/Fernando Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted June 13, 2011 Share Posted June 13, 2011 (edited) @Ptec2 Did you try anything yourself ? I don't exactly understand what you mean with the 30 seconds, but the following script will asked for a password, installs the program, runs the program and afterwards it will delete the program. Keep in mind if someone terminate this program it will leave the original executable behind. expandcollapse popup#NoTrayIcon #Region #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Add_Constants=n #EndRegion #include <EditConstants.au3> #include <GUIConstantsEx.au3> Dim $Password = "test" Dim $Pid $MyGUI = GUICreate("Enter password", 300, 70) $Ask = GUICtrlCreateInput("", 10, 10, 280, 20, $ES_PASSWORD) $Button = GuiCtrlCreateButton("Run", 210, 40, 80, 20) GUISetState () While 1 $msg = GUIGetMsg() Switch $msg Case -3 _Terminate() Case -100 To 0 ContinueLoop Case $GUI_EVENT_CLOSE _Terminate () Case $Button If GUICtrlRead($Ask) = $Password Then GUISetState(@SW_HIDE, $MyGUI) FileInstall("c:\program\program.exe", @TempDir, 1) ; Path to the executable you want to add to this program and install path $Pid = Run(@TempDir & "\Program.exe") ; Run the program just installed AdlibRegister("_CheckProgram", 1000) ; Check in the background if the program is running Else Msgbox (16, "Error", "Wrong password, Try again") EndIf EndSwitch WEnd Func _Terminate () ProcessWaitClose($Pid) FileDelete(@TempDir & "\Program.exe") Exit EndFunc Func _CheckProgram () If not ProcessExists($Pid) Then AdlibUnRegister("_CheckProgram") _Terminate() EndIf EndFunc Edited June 13, 2011 by Emiel Wieldraaijer Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Ptec2 Posted June 14, 2011 Author Share Posted June 14, 2011 Emiel, thanks for your reply. the idea of 30 seconds was just a base, you can 5 or 10 seconds, would be the time required to enter the password and after this time the script sends a return or send a confirmation, regardless of whether the password is right or not would be something automatic . 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