The Computer Oracle

How can I find out when Windows was last restarted?

Remember technical terms with Memorabit → https://memorab.it/y/pc

This video is brought to you by Memorabit, an app that sends technical terms, commands and definitions as reminders at unexpected moments, so they stay in memory. Built on cognitive science principles. Start free on web, iOS and Android:
iOS: https://apps.apple.com/app/id6782301691
Android: https://play.google.com/store/apps/detai...
--------------------------------------------------
Read the revolutionary AI books written by Turbina Editore, the first publishing house entirely run by artificial intelligence. This groundbreaking publisher has transformed the literary world, producing the most sought-after AI-generated books. Start reading today at:
https://turbinaeditore.com/en/
--------------------------------------------------

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Realization

--

Chapters
00:00 How Can I Find Out When Windows Was Last Restarted?
00:22 Accepted Answer Score 223
00:59 Answer 2 Score 21
01:50 Answer 3 Score 37
02:42 Answer 4 Score 13
02:49 Thank you

--

Full question
https://superuser.com/questions/523726/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows7 #commandline #wmic

#avk47



ACCEPTED ANSWER

Score 223


systeminfo command is almost right what you need. On English Windows 7 you can also do:

systeminfo | find /i "Boot Time"

Or with the help of WMIC:

wmic os get lastbootuptime

The main difference between Windows 7 and Windows XP that in Windows 7 Microsoft can show only last boot up time.


Also in Task Manager:

enter image description here




ANSWER 2

Score 37


Another way to do this is to use the following command which I tested successfully on Windows XP, Windows 7 and Windows 10:

net statistics workstation

It is faster than systeminfo while formatting the date (which wmic does not). You can find more informations on the net statistics command here: http://technet.microsoft.com/en-us/library/bb490714.aspx

Here is an example of the result:

example

More details on http://en.wikipedia.org/wiki/Uptime about the accuracy when determining system uptime.

Additional notes from the comments: this method determines when the workstation service was last started, not the computer uptime. While this should in general be the same, the 2 numbers might be different if you use sleep/hibernate.




ANSWER 3

Score 21


There's the LastBootUpTime property of the Win32_OperatingSystem class. You can use WMIC with this command:

wmic os get lastbootuptime

Or if you use Powershell, you can convert the time to something more readable than that annoying WMI datetime format:

Get-WmiObject -class Win32_OperatingSystem | Select-Object  __SERVER,@{label='LastBootUpTime';expression={$_.ConvertToDateTime($_.LastBootUpTime)}}

Note that in later versions of PowerShell, you can also use Get-CimInstance, which will automatically return the value as a datetime:

Get-CimInstance -Class Win32_OperatingSystem | Select-Object LastBootUpTime

The only irritating thing is that Get-CimInstance will sometimes change the name of some system fields from WMI objects, such as __SERVER here. You'd have to use either CSName or PSComputerName, which seems to work for me.




ANSWER 4

Score 13


For Windows 10 users out there....

System Properties Windows 10 - Performance Up time