xhroot

Get Time of Last Wake From Sleep in Windows 7

Start -> Paste in “Search programs and files” box:

Here’s the breakdown:

cmd /k - This opens a command session, executes the command that follows, and keeps the window open. Useful if you’re entering commands in a Run dialog; unnecessary if you already have an active command prompt.

wevtutil - Windows event log read utility.

qe - Query events …

System - … specifically from the system event logs.

/q:"..." - XPath-like query used to traverse the XML.

/rd:true - Direction, “true” shows latest first.

/c:1 - Number of results to return.

/f:text - Format output as text, which is fairly readable in this case. Could also opt for “XML”.

This simply returns the last event with a source name of ‘Microsoft-Windows-Power-Troubleshooter’. Skim through the result to verify that it’s a return from sleep event. If not, increase the number of results to return using the /c parameter.

This can also be accessed via the GUI using Start -> Run -> eventvwr -> Windows Logs -> System -> Find -> “Microsoft-Windows-Power-Troubleshooter”.

I’ve found this command useful in consulting situations where I need to track time for billing purposes.

Comments