I'd like to log the times when my computer starts up and shuts down. I don't need any diagnostic info or anything, just a simple note of the date and time, e.g. something like:

2011/04/29 08:17:34 AM Startup
2011/04/29 05:26:52 PM Shutdown

How can I do that?

My Google searches so far have yielded lots of people asking about reducing Windows startup times, but nothing of interest to the task at hand.

link|improve this question

feedback

1 Answer

up vote 8 down vote accepted

Windows uses event logs with Event Viewer to log this sort of thing:

Event ID #6005 indicates system startup

Event ID #6006 indicates system shutdown

You should create a custom view in Event Viewer that will filter those 2 event IDs with the source being the eventlog.

This is the simplest way.

Alternatively, you can use powershell's get-winevent cmdlet to create a custom filter and pipe those items to a text file.

Or... you can use the get-eventlog to pipe a custom event log (that you create with the custom views...) to a text file.

link|improve this answer
Thank you, that will be very helpful. – Will Martin Apr 30 '11 at 5:45
Is there any way to know system login\sleep times? – Viktor Sehr Feb 1 at 17:32
feedback

Your Answer

 
or
required, but never shown

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