mikebob Posted February 13, 2007 Posted February 13, 2007 I have a script that keeps pausing, see below. How can I have this script run without pausing in case someone clicks other windoews or keystrokes as the script is running. I want it to run to completion regardless if the user hits any keys or windows, script is used to remove Novell client on PCs Also not sure if there is any way to hide any of the windows that show up Here is the script below -------------------------- Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient") If WinWaitActive("RUNDLL", "loading NWSETUP", 3) = 1 Then Send("{ENTER}") Exit EndIf If WinWaitActive("Uninstall Novell Client for Windows", "uninstall the Novell Client") = 1 Then Send("{ENTER}") WinWaitActive("NMAS Client Components", "remove NMAS Client Components", "&Yes") Send("!y") WinWaitActive("NMAS Client Components", "has been successfully uninstalled") Send("{ENTER}") WinWaitActive("Uninstall Novell Client for Windows", "shut down and restart your computer") Send("!y") EndIf
Paulie Posted February 13, 2007 Posted February 13, 2007 I have a script that keeps pausing, see below. How can I have this script run without pausing in case someone clicks other windoews or keystrokes as the script is running. I want it to run to completion regardless if the user hits any keys or windows, script is used to remove Novell client on PCsAlso not sure if there is any way to hide any of the windows that show upHere is the script belowUnless you can do it using controlclick or controlsend, you can't send keystrokes or mouse clicks to minimized windows
mikebob Posted February 13, 2007 Author Posted February 13, 2007 Unless you can do it using controlclick or controlsend, you can't send keystrokes or mouse clicks to minimized windowsOK thanks, any way to at least stop the script from pausing? If the user moves the mouse oor clicks on a program while the script it running the script will pause. Anyway to force the script to run till completion?
BrettF Posted February 13, 2007 Posted February 13, 2007 (edited) The script pauses because of a certain line:WinWaitActiveWinWaitActive according to the helpfile, Pauses execution of the script until the requested window is active.Hope that helps... Edited February 13, 2007 by bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
mikebob Posted February 13, 2007 Author Posted February 13, 2007 Thanks, Script runs fine it I do not move the cursor or click anything. But If I do autoit icon in the systray shows paused and will not finish until I uncheck the PAUSED option.
MHz Posted February 13, 2007 Posted February 13, 2007 Thanks,Script runs fine it I do not move the cursor or click anything. But If I do autoit icon in the systray shows paused and will not finish until I uncheck the PAUSED option.Use WinWait() and Control*() functions for reliability. You can use the directive #NoTrayIcon to hide the systray icon or use Break() to make the systray icon unresponsive.Use the above or use silent install switches if available will make your installations far more successful.
mikebob Posted February 13, 2007 Author Posted February 13, 2007 thanks, can you give me an example of how this will be coded in the above script?
MHz Posted February 13, 2007 Posted February 13, 2007 Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient") If WinWait("RUNDLL", "loading NWSETUP", 3) Then ControlClick("RUNDLL", "loading NWSETUP", "Button?") Exit EndIf If WinWait("Uninstall Novell Client for Windows", "uninstall the Novell Client", 60) Then ControlClick("Uninstall Novell Client for Windows", "uninstall the Novell Client", "Button?") WinWait("NMAS Client Components", "remove NMAS Client Components") ControlClick("NMAS Client Components", "remove NMAS Client Components", "Button?") WinWait("NMAS Client Components", "has been successfully uninstalled") ControlClick("NMAS Client Components", "has been successfully uninstalled", "Button?") WinWait("Uninstall Novell Client for Windows", "shut down and restart your computer") ControlClick("Uninstall Novell Client for Windows", "shut down and restart your computer", "Button?") EndIf I cannot fill in the ClassNameNN's to being correct as you need to get the information with the AutoIt Info Tool. Update the "Button?" to example "Button1" as shown by AutoIt Info Tool to complete. AutoIt Info Tool Example Press CTRL-ALT-F to freeze the display. >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: AutoIt v3.2.0.1 Setup Class: #32770 Size: X: 96 Y: 672 W: 503 H: 393 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 470 Y: 1040 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0xF5F5F2 Dec: 16119282 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 324 Y: 327 W: 75 H: 23 Control ID: 1 ClassNameNN: Button2 Text: &Next > Style: 0x50010001 ExStyle: 0x00000004
mikebob Posted February 14, 2007 Author Posted February 14, 2007 thanks workd good. Only thin I didnt need a button fot the first part. How do I get the inital scren that says DO you want to uninstall to click yes quicker? It stays there for about 3 secods before it gets clicked
MHz Posted February 14, 2007 Posted February 14, 2007 Strange if it hangs a few seconds but it maybe busy working in the background, so just hide the window so it is out of the way. Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient") If WinWait("RUNDLL", "loading NWSETUP", 3) Then ControlClick("RUNDLL", "loading NWSETUP", "Button?") Exit EndIf If WinWait("Uninstall Novell Client for Windows", "uninstall the Novell Client", 60) Then WinSetState("Uninstall Novell Client for Windows", "uninstall the Novell Client", @SW_HIDE) ControlClick("Uninstall Novell Client for Windows", "uninstall the Novell Client", "Button?") WinWait("NMAS Client Components", "remove NMAS Client Components") ControlClick("NMAS Client Components", "remove NMAS Client Components", "Button?") WinWait("NMAS Client Components", "has been successfully uninstalled") ControlClick("NMAS Client Components", "has been successfully uninstalled", "Button?") WinWait("Uninstall Novell Client for Windows", "shut down and restart your computer") ControlClick("Uninstall Novell Client for Windows", "shut down and restart your computer", "Button?") EndIf
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