SignalChief Posted October 23, 2010 Share Posted October 23, 2010 (edited) I made a script that works but as I am learning, I am trying to expand as well. I am trying to make it where when the script is ran, a popup box comes up asking for user input. After the user inputs the data and clicks OK, that data is placed in the script. I also can't seem to get the script to continue after you click OK from the GUI. Below is what I have, Its really been bugging me and I feel like I am overlooking something really simple. GUICreate("Enter Document Number", 300, 100) $file = GUICtrlCreateInput("W", 10, 5, 300, 20) GUICtrlCreateButton("OK", 70, 50, 60) GUISetState(@SW_SHOW) Sleep(45000) ; Opens Command Prompt Run("cmd.exe") ; What I want to be wrote in CMD Send("SQLPLUS RUN AS SYSDBA{ENTER} {ENTER}DELETE FROM LOGMAINT.DCRHISTORY WHERE DOCUMENTNBR= 'GUICtrlRead($file)';{ENTER}") Send("DELETE FROM LOGMAINT.DOCCTLREGISTER WHERE DOCUMENTNBR= 'GUICtrlRead($file)';{ENTER}")Hello, Edited October 23, 2010 by SignalChief Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 23, 2010 Moderators Share Posted October 23, 2010 SignalChief,Welcome the the AutoIt forum. If you are looking for just the one piece of information, why not use InputBox? That way you block the script until you select a button on the dialog and the script then continues automatically. You save the user-inserted value in a variable and then use a bit of errorchecking to make sure something was actually entered. Looking at the Send commands, you need to use the concatenation operator & to join strings. I would suggest something along these lines:$file = InputBox("Enter Document Number") If $file <> "" Then Run("cmd.exe") Send("SQLPLUS RUN AS SYSDBA{ENTER}{ENTER}DELETE FROM LOGMAINT.DCRHISTORY WHERE DOCUMENTNBR= " & $file & ";{ENTER}") Send("DELETE FROM LOGMAINT.DOCCTLREGISTER WHERE DOCUMENTNBR= " & $file & ";{ENTER}") EndIfPlease ask if there are any questions. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SignalChief Posted October 23, 2010 Author Share Posted October 23, 2010 Thanks for the welcome! Thanks for the quick response as well. I didn't know about the input box but it is definitely easier than what I was trying to do. Below is my final code that works. One last question though, is there a way for me to hide the commands that are given? Right now, when someone clicks on my .exe, it displays the commands and I don't want my users seeing that. I assume, I can use some type of "@echo off"? I am still searching as I type this. $file = InputBox("Hero Tool","Enter Document Number you want to delete:","W") If $file <> "" Then Run("cmd.exe") Send(" SQLPLUS RUN AS SYSDBA{ENTER}{ENTER}DELETE FROM LOGMAINT.DCRHISTORY WHERE DOCUMENTNBR= '" & $file & "';{ENTER}") Send("DELETE FROM LOGMAINT.DOCCTLREGISTER WHERE DOCUMENTNBR= '" & $file & "';{ENTER}COMMIT;{ENTER}") EndIf Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 23, 2010 Moderators Share Posted October 23, 2010 SignalChief,Has your search got as far as _RunDOS yet? I have not used it, but it looks as if it does what you want.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SignalChief Posted October 23, 2010 Author Share Posted October 23, 2010 I did come across that but I need to use the "send" function as my password is null. The other way won't let me do it unless I use command.com or command.exe. Anyway, thanks for assisting and helping expand my thoughts. SignalChief 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