2

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

CharlieRB
  • 22,754

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,421
TomEus
  • 3,725
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,421
  • 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”.