2

I'd like to get the uptime of my computer, and also power events, like when the computer goes to sleep and when it's waking up. Bonus points if it tells why it's waking up: scheduled task, user interaction, magic packet, ...

Microsoft released ages ago an uptime command that does that, when used with some extra parameters:

  • /s Display key system events and statistics.
  • /a Display application failure events (assumes /s).

When used without any parameters, uptime works but gives only the ... uptime. However, when used with /a or /s, it crashes.

Do you know a similar program that display also the "key system events and statistics"? The System Event Log gives information on when it goes to sleep but not more.

I'm running Windows 7 Ultimate 64-bit, if it matters.

Thanks a lot!

1

4 Answers 4

5
+100

Mark Russinovich of Sys Internals (since bought^W absorbed by Microsoft) has a suite of tools which, in one form or another, solve most of what your looknig for:

PSInfo returns, in amongst everything else, uptime.

PSLogList in the same group will dump the even log.

Forgot to add: All of the SysInternals tools are very good. Many are quite useful, especially for Unix-ish people looking for focused tools to get fairly specific information, ofetn command-line or command line compatible.

Get to all of them at http://www.sysinternals.com (which will be redirected to the deep page in Microsoft's site).

2
  • +1 ... Speaking of Sysinternals, their program BGInfo will display the boot time on the desktop :)
    – Molly7244
    Feb 3, 2010 at 1:43
  • There's also live.sysinternals.com, a live repository of all their tools.
    – fretje
    Feb 6, 2010 at 21:06
7

As far as application failures go you probably have more luck with Windows' Reliability Monitor:

Reliability monitor

That one doesn't show system bootup or shutdown but it shows application crashes, system crashes, installed software and updates, etc.

If one gets a reasonable idea what exactly is a "key system event" for uptime.exe then it's probably not hard to recreate with PowerShell.

2
  • Thanks for pointing out the Reliabily Monitor, I did not know about it. But having applications crashes in the tool would be nice but not absolutely mandatory. I'll check further in the event logs and with Powershell (though I'm more a Perl and Python type of guy ;-) ). Thanks!
    – Snark
    Sep 6, 2009 at 11:03
  • Well, PowerShell has the advantage of being included with Windows 7.
    – Joey
    Sep 6, 2009 at 17:03
3
net stats workstation | find "since"
powercfg -lastwake
pause

put those lines into a .bat file, and execute him to report information about what woke the system from the last sleep transition and the UPTIME

1

This is probably unrelated, but if you open Task Manager, under the Performance tab, and the System group at the bottom, "Up Time" is listed in Days:Hours:Minutes:Seconds".

Not sure if any application exists that does the type of Auditing you want, you can check the Event Viewer, it may do just that, but i'm not sure.

1
  • Yes, I know about the Task Manager and SystemInfo command, but it only gives the uptime, not the power events. As said in my question, I already looked in the System Event log but only found the "Entering sleep" events.
    – Snark
    Sep 6, 2009 at 6:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .