[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Detect when Windows has finished loading

Posted on 2010-08-23
10
Medium Priority
?
338 Views
Last Modified: 2012-05-10
Hi,
Is there a key (or anything) that i can read from windows to know that it  has finished loading?
Can you provide some techniques to detect when Windows has finished loading especially using WMI, Visual Basic6 or Windows API?
I have a program that runs at startup, and i need it to open after the windows has finished loading (network is initialized etc).
Regards,
Cristi
0
Comment
Question by:Cristi_E
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 33500461
if your program is runs from startup, then u can bet windows has finished loading...if it is depend on specific process/service, u can query their status to make sure they are loaded and running
0
 
LVL 4

Author Comment

by:Cristi_E
ID: 33500501
For example it reads all the installed printers. Some times it tells that there are no installed printers bechause it cannot read them (or the returned value by the WMI is that there are no printers) and that is i think bechause Windows did not finished loading.
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 33500570
so you need to make sure the Spooler service is running and then it should give you list of installed printers.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 4

Author Comment

by:Cristi_E
ID: 33500633
Yes in this particular case. It also tryes to connect to the internet and check if a licence is still valid, and also some tymes return a error bechause the network is not ready.
So should i understand that there is no universal method to tell taht windows has finished loading and it is ready to be used?
I really need that for all my programms that run at startup and perform som tasks.
0
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 2000 total points
ID: 33500710
windows finished loading is pretty much abstract term, cause to some services are being loaded by windows asynchronously and it take some time for them to run.
other services/applications are dependent on other services/applications to run so it comes to the point where you need to list the requirements by which your program can safely start to run.
this is a known issue and it's being addressed differently depends on the environment.
the most common issue is internet dependency, when it is a requirement for an application to run.
in this case the application detect if internet connectivity is available before starting its tasks.
0
 
LVL 4

Author Comment

by:Cristi_E
ID: 33500768
OK.
So in my case when i use WMI to read all the installed printers, what should i check first before trying to read them? Is it possible that WMI itself not being ready when i try to use it?
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 33500804
you can be positive to use WMI when your program was launched, if that what you are concern about.
0
 
LVL 42

Assisted Solution

by:Meir Rivkin
Meir Rivkin earned 2000 total points
ID: 33500812
in case of installed printers, check that the spooler service is running.
0
 
LVL 86

Expert Comment

by:jkr
ID: 33500927
Just add your program to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

and it will be execuuted as soon as Windows has finished loading and before a user logs on. See also http://support.microsoft.com/kb/179365 ("INFO: Run, RunOnce, RunServices, RunServicesOnce and Startup")
0
 
LVL 4

Author Closing Comment

by:Cristi_E
ID: 33501029
Thenks for help!
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question