Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Is your script running *after* a logon, or is it being run via the "RunService" registry key [on Win9x] / as a native NT service [on WinNT]?
Short of having somebody logon so that "explorer.exe" is running on the system console, you're going to have some difficulty doing this 100% reliably.
On the WinNT platform, I'd suggest monitoring all services and wait for some period of time after last one in the "starting" state changes to the "started" state.
On the Win9x platform - Yuck! I'd also say wait for the WinLogon program to display the GINA logon screen [on WinNT platform] or for the Windows Logon dialog box to be displayed [on Win9x platform], but even then you have to wait for some variable amount of time after those are displayed and the time varies significantly based on the version of Windows and the applications that are installed.
Maybe monitor CPU utilization and wait until it drops down below a certain sustained average value? Even that could bite you, though.
Your points are interesting, hopefully they can be clarified for this type of environment.
Are these other programs going to continue running, or do they end up terminating when the are complete? Maybe your script could use the process extender to count the running processes and wait until certain programs have been running for a period time while also waiting for others to have terminated. For the most part, this is going to take being familiar with the Windows configuration that you are using so that you can determine what should or shouldn't be running when the desktop is "stable".
You might also want to wait for the window named "Program Manager" to exist. This is a hidden window that explorer.exe maintains for backwards compatibility with the DDE server functionality that was supported by progman.exe. This hidden window doesn't get created until after explorer.exe has finished its initialization tasks and has actually displayed the desktop.
Article ID: W16456
File Created: 2005:02:18:12:20:50
Last Updated: 2005:02:18:12:20:50