RonnieK Posted May 5, 2013 Share Posted May 5, 2013 How can I keep the script running if another window pops up? the exact command would be appreciated. This is what I've tried after the enter command. standard command prompt in windows fyi. controlsend ("Windows Command Processor") controlsend ("{Windows Command Processor}") ;Ronnie K. ;Par and Rar Removal ;12.27.2012 Send ("#r") sleep (1000) send ("cmd") sleep (2000) send ("{enter}") SLEEP (2000) send ("D:") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.RAR /S") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.PAR /S") send ("{enter}") SLEEP (2000) send ("E:") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.RAR /S") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.PAR /S") send ("{enter}") SLEEP (2000) send ("F:") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.RAR /S") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.PAR /S") send ("{enter}") SLEEP (2000) send ("G:") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.RAR /S") SLEEP (2000) send ("{enter}") SLEEP (2000) SEND ("DEL *.PAR /S") send ("{enter}") SLEEP (5000) SEND ("EXIT") send ("{enter}") SLEEP (2000)ParRarRemoval.au3 Link to comment Share on other sites More sharing options...
Neutro Posted May 5, 2013 Share Posted May 5, 2013 Hello!Instead of using a "cmd" interface for deleting file, you can use an autoit function for this called FileDeleteTry this:Filedelete("D:\*.RAR") Filedelete("D:\*.PAR") Filedelete("E:\*.RAR") Filedelete("E:\*.PAR") Filedelete("F:\*.RAR") Filedelete("F:\*.PAR") Filedelete("G:\*.RAR") Filedelete("G:\*.PAR")This will work even if another window will pops up! Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Nessie Posted May 5, 2013 Share Posted May 5, 2013 You can do that in pure autoit: Dim $aDevice[4] = ["D", "E", "F", "G"] ;If you have other drive just add the letter here For $i = 0 To UBound($aDevice) - 1 If DriveStatus($aDevice[$i] & ":\") <> "READY" Then ContinueLoop ;If drive is not ready or not exist just continue loop ConsoleWrite($aDevice[$i] & @CRLF) ;Debug only FileDelete($aDevice[$i] & ":\*.rar") FileDelete($aDevice[$i] & ":\*.par") Next MsgBox(0, "Done", "It's all ok!") Hi! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
RonnieK Posted May 8, 2013 Author Share Posted May 8, 2013 First and Foremost, thank you for helping a newbie like me, I sincerely appreciate it. how about this : ( a better example of the window issue:) WinActivate ("BMC Remedy User - [incident (New)]") WinWaitActive ("BMC Remedy User - [incident (New)]") SLEEP (1000) SEND ("+{TAB 11}") SLEEP (2000) Send ("U") Send ("U") SEND ("{ENTER}") If something else pops up and takes away focus, what command will either pause the script until the window is active again or will re force that window to become active? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 8, 2013 Moderators Share Posted May 8, 2013 Take a look at ControlSend in the help file. It is much more reliable than Send, and doesn't rely on the window being active. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
RonnieK Posted May 8, 2013 Author Share Posted May 8, 2013 JLogan,If i enter Control Send ("+{TAB 11}")I get incorrect number of parameters in function call. Could you provide an example? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 8, 2013 Moderators Share Posted May 8, 2013 RonnieK,Take a look at ControlSend in the help fileHave you? I think not because if you do so it will be obvious that the syntax of your call is wrong - and also what the other parameters should be. So go and read the Help file now - and come back if you have specific questions on the parameters. 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...
RonnieK Posted May 8, 2013 Author Share Posted May 8, 2013 RonnieK, Have you? I think not because if you do so it will be obvious that the syntax of your call is wrong - and also what the other parameters should be. So go and read the Help file now - and come back if you have specific questions on the parameters. M23 I searched the help file, searched google AND spent an hour trying to figure it out by myself BEFORE my original post. I obviously am stuck and asked for assistance. Just because something is obvious to you ( 15,000 posts + i'll assume you're fairly good with autoit) doesn't mean it is to everyone. The issue isn't so much the syntax as I'm not 100% sure if Control send is the right command to keep a window active. I found SendKeepActive ("BMC Remedy User - [incident (New)]") Which keeps the window active (the answer to my original question) now I've moved on to running the script in an inactive window. I have been tinkering with autoit for maybe 5 hours total. Melba 23 -Thank you for absolutely nothing. To everyone else, a sincere thanks and appreciation. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 8, 2013 Moderators Share Posted May 8, 2013 (edited) RonnieK, Stop acting the martyr - it is patently obvious that you have not even looked at the Help file for that command or you would not have tried to use: Control Send ("+{TAB 11}") as it bears no resemblance at all to the syntax required for ControlSend - you do not need many posts at all to realise that. I'm not 100% sure if Control send is the right command to keep a window activeDid you even read what JLogan3o13 said above? Let me repeat it for you: "Take a look at ControlSend in the help file. It is much more reliable than Send, and doesn't rely on the window being active" So I suggest you stop acting all injured and go read about ControlSend. if you have questions about the necessary syntax for the command or about how you find the parameter values, then do please ask again. M23 Edited May 8, 2013 by Melba23 Typos Wombat 1 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...
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