2

From the command line, how do I find when the last time a Windows 7 computer has been restarted?

CharlieRB
  • 22,566
  • 5
  • 56
  • 105
Chad Harrison
  • 6,069
  • 13
  • 44
  • 60
  • Possible duplicate of [How to find out uptime on Windows?](http://superuser.com/questions/11287/how-to-find-out-uptime-on-windows), http://superuser.com/questions/377225/how-to-find-the-uptime-in-windows etc. Also see http://superuser.com/questions/564119/windows-8-reports-wrong-uptime-possibly-total-hybrid-boot-uptime for Win8. – Karan Apr 01 '13 at 22:11

3 Answers3

3

Open a Command Prompt by going to Start and opening “cmd”. You will then be presented with a command prompt window, where you need to type the systeminfo command below:

C:\> systeminfo | find "Boot"
System Boot Time:          05/06/2013, 12:55:07
Bob Stein
  • 1,383
  • 1
  • 16
  • 23
TomEus
  • 3,657
  • 18
  • 35
  • 2
    Note that systeminfo will [drift with sleep and hibernate](http://en.wikipedia.org/wiki/Uptime#Using_systeminfo). An alternative is to use [net stats server](http://support.microsoft.com/kb/555737), which will return faster as it won't have to parse all the Windows Update data. – ernie Apr 01 '13 at 17:41
0
tasklist /v | find "Idle"

On Windows 7, tasklist will output something (ugly and wrapped) such as:

System Idle Process              0 Services                   0         24 K Unk
nown         NT AUTHORITY\SYSTEM                                   449:12:23 N/A

Which in this case means 449 hours (almost 20 days) of system-idle since the last reboot. Of course, this is a rough approximation of time since reboot; it doesn't include actual useful CPU-time.

Bob Stein
  • 1,383
  • 1
  • 16
  • 23
  • Change that to `tasklist /v /fi "pid eq 0" /fo list | find "CPU Time"` and you (a) eliminate the risk that you will stumble across some other process that has `Idle` in its name, and (b) get a less ugly result (that fits generally in 40 characters or fewer).  Note that, either way, this reports the idle ***CPU*** time.  If your system has two CPUs, this can be up to 2× the real elapsed time. – Scott - Слава Україні Apr 01 '13 at 18:05
0

Use

net statistics workstation | find "Statistics since"

or

net statistics server      | find "Statistics since"

These commands can be abbreviated  “net stats work”  or  “net stats srv”.