Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the computer's last wake time

Tags:

.net

windows

I know I can get the time since the last boot using Environment.TickCount
But is it possible to get the last time a compute woke up from hibernation or sleep?

(Without using WMI please)

like image 758
sternr Avatar asked Oct 18 '25 02:10

sternr


1 Answers

Try this command - use Process to fire it off - you'll need to parse the result

cmd /k wevtutil qe System /q:"*[System[Provider[@Name='Microsoft-Windows-Power-Troubleshooter']]]" /rd:true /c:1 /f:text

Lifted from here if you want more info...

like image 91
PaulB Avatar answered Oct 20 '25 22:10

PaulB



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!