Sign in to follow this  
Followers 0
Probs

Adding a script timeout

2 posts in this topic

Hi folks,

Essentially I have written a small script to remove two bits of software. This is all good and well however I would like to add a timer which counts down 5 minutes and then kills the script if it hasn't finished already. This is because if someone runs the script after the apps have been removed we are likely to get an error.

Anyways, code as follows

RunWait("msiexec.exe /x {309C3793-54FA-4145-AA14-27ACBE8D926E} /qb /norestart")

Run(@COMSPEC & " /C Start RUNDLL32 NWSETUP.DLL NWUninstallClient")
;ShellExecute(""command /c RUNDLL32 NWSETUP.DLL NWUninstallClient"")

WinActivate("Uninstall Novell Client for Windows")

if (WinWaitActive("Uninstall Novell Client for Windows")) Then

; Click the "Yes" button
    ControlClick("Uninstall Novell Client for Windows", "Yes", "")
    
EndIf

if (WinWaitActive("Uninstall Novell Client for Windows")) Then

; Click the "Yes" button
    ControlClick("Uninstall Novell Client for Windows", "Yes", "")
    
EndIf

Like I say I just want a timer which will after say 10 minutes kill the script regardless. I know it's not great but it should do for now :)

Cheers guys n gals,

- Probs

Share this post


Link to post
Share on other sites



WinWait*() functions have a TIMEOUT parameter. I think that could be the best way. If the window that's being expected doesn't appear, the function returns 0.

Also, I'm guessing that there are ways (like reading the registry or running other applications) that could tell you that the apps were already unistalled. This could be checked at the begining of the script to avoid doing things in vain.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0