Define Reboot

Is there any “download session id” or (reliable) “download timestamp”? For installation, I need to discover that a scheduled reboot really took place.

I think I could make the MoveFileEx() mannequin with MOVEFILE_DELAY_UNTIL_REBOOT , but I was hoping for something easier.

(We need to install a third-party package, which sometimes behaves erratically after a repair / update. In this state, access to the device may even block the system)

(Windows XP, Vista, 7)

+4
source share
4 answers

Obviously, Windows has the equivalent of “uptime”. Here's more information: http://support.microsoft.com/kb/555737

As I understand it, this should tell you how long the system booted. Will this information help solve your problem?

+3
source

For such things, WMI (Windows Management Instrumentation) is often a good starting place. I know that you can get the current uptime directly through it, which may allow you to determine if the computer rebooted.

Here is a blog post with some code examples: http://blogs.technet.com/heyscriptingguy/archive/2004/09/07/how-can-i-tell-if-a-server-has-rebooted.aspx

Depending on the implementation language, you probably just want to output the request code from vbscript.

+4
source

You can search the system event log for event 6009 from the EventLog source — this is the first event recorded after each reboot.

+1
source

I think the best answer is already given here: Find out if the computer has restarted since the start of my program?

This seems to be the easiest way. Use GlobalFindAtom() to find out if it exists and create it, with GlobalAddAtom() , if it is not. This will continue after the execution of your program. If your application starts up again and sees that the atom exists, then this is not the first launch since the reboot.

If the computer restarts, then the atom will not exist, indicating that this is the first start of your program from the moment of reboot.

+1
source

All Articles