Jump to content

Help with Timer in Do/Until Loop


 Share

Recommended Posts

Hello!

Can someone help me with a Do/Until loop that only waits 10 minutes to see if a condition is meet and then exits the loop?

I have the following Do/Until loop that currently waits until the registry key is created...

Do
    Sleep(5000)
    $RegKey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion\Tasks\{A14CD6FC-3BA8-4703-87BF-E3247CE382F5}", "szTaskName")
Until $RegKey = "AutoUpdate"

...but now I only want it to wait a maximum of 10 minutes.

Any help would be greatly appriciated! ;)

Thanks.

Link to comment
Share on other sites

  • Developers

$Timer = TimerInit
Do
    Sleep(5000)
    $RegKey = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion\Tasks\{A14CD6FC-3BA8-4703-87BF-E3247CE382F5}", "szTaskName")
Until $RegKey = "AutoUpdate" or TimerDiff($Timer) > 60 * 10 *1000

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

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