Jump to content

Recommended Posts

Posted

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

Posted

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

Unless you can do it using controlclick or controlsend, you can't send keystrokes or mouse clicks to minimized windows
Posted

Unless you can do it using controlclick or controlsend, you can't send keystrokes or mouse clicks to minimized windows

OK 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?

Posted (edited)

The script pauses because of a certain line:

WinWaitActive

WinWaitActive according to the helpfile,

Pauses execution of the script until the requested window is active.

Hope that helps...

Edited by bert
Posted

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.

Posted

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.

:whistle:

Posted

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.

:whistle:

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

Posted

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

Posted

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

:whistle:

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...