From the command line, how do I find when the last time a Windows 7 computer has been restarted?
Asked
Active
Viewed 3,203 times
2
-
Possible duplicate of 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 Answers
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
-
2Note that systeminfo will drift with sleep and hibernate. An alternative is to use net stats server, 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,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 hasIdlein 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”.
Scott - Слава Україні
- 21,717