Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I know when my computer running Windows 7 was last restarted?

I prefer a solution that doesn't involve searching the event log, but something like wmic or maybe cmd commands.

share|improve this question
up vote 72 down vote accepted

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

share|improve this answer
Also , is there any accumulative list of last resets ? – Royi Namir Dec 24 '12 at 14:40
@RoyiNamir: With some googling list of reboots (looks very similar): Get-EventLog -LogName System | where { ($_.InstanceId -bAnd 0xFFFF) -eq 6006 } – m0nhawk Dec 24 '12 at 15:08
it is powershell ..... ? – Royi Namir Dec 24 '12 at 15:10
You can also see the list in event viewer like so:… I'm sure you can query this with PowerShell's Get-WinEvent but I haven't investigated that at all. – Bacon Bits Dec 24 '12 at 15:11

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 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 often blank out the computer name fields from WMI objects, such as __SERVER here.

share|improve this answer
20121217175810.414696+120 I think I need damn good calculator to calc time – Royi Namir Dec 24 '12 at 14:43
@Royi Yeah, WMI timestamps are stupid. It's a CIM_DATETIME, which is the format required by the standard. It's yyyymmddHHMMSS.mmmmmmsUUU, using 24 hour time. Here, your last reboot time is Dec 17, 2012 at 5:58 PM.… – Bacon Bits Dec 24 '12 at 14:53
Handy bonus of using the get-wmiobject method is it makes it trivial to get boot times of remote computers too. Just add "-computer <computername>" to the command (before the pipe) – camster342 Oct 20 '13 at 22:22

One other way to do this is to use the following command-line that works both in Windows XP and Windows 7:

net statistics workstation

It has the advantage of being faster than the systeminfo alternative while formatting the date (which wmic does not). You also get a few other informations that can be useful if you are actually using this command for debugging a computer (since you are asking specifically for cmd, I'm assuming you are not doing this programatically).

You can find more informations on the net statistics command here:

Here is an example of the result (using a French copy of Windows 7 Pro SP1 x64, user-language doesn't matter much for the command-line):


(the computer name is purposely blurred)

More details on about the accuracy when determining system uptime.

share|improve this answer
any idea why this doesn't read the same as using systeminfo or wmic... it's probably negligible, but it differs on my system by over 2 minutes – Anthony Shaw Dec 11 '14 at 20:31
It does differ for aobut 40 seconds on my computer too. I don't have any idea why it's not exactly the same, I guess the service just boots a little bit latter. Some interesting info on – dnLL Dec 11 '14 at 21:33

This is an expansion to @m0nhawk's answer

In PowerShell you could do

$date = wmic os get lastbootuptime | Select-String "\d\S+" | % { $_.Matches } | % { $_.Value }

Ridiculous how much code is needed for such a simple task

share|improve this answer

On Windows 7 I prefer

net statistics workstation

WMIC doesn't take into account sleep time, and I leave my workstation locked up at work sleeping during the week, ready to wake up the next day.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.