Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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