Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 29 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
1  
@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: howtogeek.com/72420/… 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)}}
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
4  
@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. msdn.microsoft.com/en-us/library/windows/desktop/… –  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

Your Answer

 
discard

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.