Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Where on the system or registry should I look for data on how many times Windows has been rebooted? I want to create an application that uses this information (how many times Windows has rebooted since the OOBE* process) to implement a specific feature.

I'm sure that Microsoft may have implemented this somewhere. I'm thinking about a registry key or something like this.

*OOBE - Out Of Box Experience, this is the process that happens when you boot-up your Windows for the first time and set-up the user, password and computer names.

share|improve this question
Through careful perusal of the event logs you can figure this out, but I don't think it's actually logged specifically someplace...hmm. Hopefully I'm wrong! –  Shinrai May 2 '11 at 14:10
add comment

5 Answers

Each startup and shutdown is recorded in the Event Logs. Open the Event Viewer, and go to the System logs section. If you filter these records (Use the Filter Current Log button on the right) by the Event Numbers 12 and 13, you should just get the events notifying when the system is shutting down and starting up.

Event ID 12 is the system starting up, Event ID 13 is the system shutting down. It also provides the exact time when the event was logged in the event itself.

You could get your application to count the number of events with Event ID 12, which should give you what you want.

share|improve this answer
Good thought, but there are caveats: the event logs can be cleared by a user, and they are limited to a maximum size, so it wouldn't necessarily report the total amount of restarts, especially if it's an old install. –  rmart May 18 '11 at 20:59
@rmart I don't know whether the average user would clean out the Event Logs, but they are both fair points. I think using the S.M.A.R.T. data as mentioned above is probably a better way, but that isn't without it's caveats either. –  Connor W May 19 '11 at 10:12
add comment
up vote 10 down vote accepted

I found the answer.

Find over:

"HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters\BootId" 

The value, in decimal, that you will see is the number of times that your system already rebooted.

share|improve this answer
576 times, a veryu interesting question and answer. +1 from me. –  Joe Taylor Jul 11 '11 at 18:22
add comment

Here's another way : S.M.A.R.T

The vast majority of hard drives these days store SMART information. There are two pieces of informations you might be interested in : 04 Start/Stop Count 12 Power Cycle Count

Check out the wikipedia article on S.M.A.R.T and possibly the documentation of smartmontools.

smartmontools is an open-source project which can query this data in a CLI, or there are other programs around that can get this data with various GUIs : Wikipedia list of SMART tools

share|improve this answer
I think this is probably a more reliable method than using the Event Viewer, but it has it's caveats also. Unless the drive has been in the same computer from day one, without being changed or used elsewhere, you wont get accurate results. Also, I think older drives don't fully support S..M.A.R.T., so you may find some drives that record power cycle information, and others that don't. –  Connor W May 19 '11 at 10:16
@Connor W : I was guessing that the sort of hard-drives that don't record SMART information were pretty unlikely to be in a machine powerful enough to run Windows 7, but yes, you're entirely right that it can't be relied on. Just like event viewer.... –  camster342 May 20 '11 at 1:32
Also what about if the user uses standby mode or the hard drive turns off due to inactivity? –  sinni800 Jun 16 '11 at 13:18
@Sinni : Thats what the difference between the 04 code and the 12 code is. 04 is total hard drive spin-ups which would include standbys and powersaving modes. 12 is where the Hard Drive loses power completely, from the PC Shutting down or going into hibernate. –  camster342 Jun 17 '11 at 5:59
add comment

Check out the Reliability Manager in Windows 7

share|improve this answer
This doesn't really tell you when the computer has booted up or shut down though. –  Connor W May 2 '11 at 15:33
add comment

I've written two short scripts which can count the number of times a computer has turned on.

Unfortunately there isn't an event log for restarts, only for when the Windows starts on and shuts down. The script searches the event log for event 12 which is logged when Windows starts. It then tells you how many times it has counted.

More information is here

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.