WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Reboot Issues

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Determine Reboot

Keywords: 	  determine reboot  tick counter gettickcount

Question:

We are deploying SP2 on Windows 2000. We are not forcing a reboot at the end. How can I determine when the last reboot occurred? Maybe a registry key?

Answer:

This will work as long as the last reboot was not more than about 43 days ago....
ticks=GetTickcount()
secs=ticks/1000
now=TimeYmdHms()
boot=TimeSubtract(now,"0000:00:00:00:00:%secs%")
Message("Last Reboot maybe at",boot)

Question (cont'd):

Thank you...I'll definitely try that! Just out of curiousity...why 43 days?

Answer:

The "tick" counter is a 32 bit number counting in 1/1000's of a second.

In about 43 days it rolls over and starts at zero again.


Article ID:   W14854
File Created: 2001:11:08:12:40:32
Last Updated: 2001:11:08:12:40:32