Jump to content

Runonce, Wait For Windows To Load


 Share

Recommended Posts

Windows XP Home

AutoIt v3 build 101 pub 11Mar2004

I wrote a WinXP Home cleaning script that runs via RunOnce. Upon restart the runonce routine is triggered...

;runonce routine

;Sleep for a bit to let Windows Fully Load

Sleep(30000) ;30seconds

;start doing stuff

I learned how to use runonce from reading posts by Larry for AutoIt v2.64.

With AutoIt v3, perhaps there is a better way than sleep.

With AutoIt v3 is there a way to determine when Windows is fully loaded?

Maybe using processexisits() or something?

My script is for Windows XP & Windows 98.

Thank you,

Lilla

Link to comment
Share on other sites

  • Developers

Hmmm ... Isn't the RunOnce registry key what it says ?

I thought that the program defined in RunOnce is run before anything else at startup time and only one time.

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

Hmmm ... Isn't the RunOnce registry key what it says ?

I thought that the program  defined in RunOnce is run before anything else at startup time and only one time.

Yes, indeed it does exact that. The problem is that a program started via RunOnce starts running before windows is fully loaded, and this can cause your code to fail.

Under AutoIt v2.64, the workaround is to sleep awhile to assure that windows is fully loaded before you start doing stuff. Larry's AutoIt v2.64 sample script allows 30 seconds so that's what I use. I tried 15 seconds, and I had problems, so I moved it back to 30 seconds. But, I wonder if perhaps some machines could need more than 30 seconds?

Under AutoIt v3, I wonder if there are one/more processes I could monitor to determine when windows is fully loaded, at that point I know I can safely begin doing stuff in my RunOnce code?

Lilla

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...