Is there a way to find out what put computer into sleep mode?

dc2000

New member
Member
VIP
Local time
9:14 AM
Messages
153
I know that there's a good powercfg command line call that can tell what last woke up computer from sleep:

powercfg /lastwake

what I need is a reverse -- command/software to tell me what was the last process that put computer into automatic sleep?

PS. I've done all the usual checks in the power settings and such. None were found. The system in question has some running service/process that puts it into automatic sleep after a predictable amount of time. I just need to find which one it is.
 

My Computer My Computer

At a glance

Windows
OS
Windows
I know that there's a good powercfg command line call that can tell what last woke up computer from sleep:

powercfg /lastwake

what I need is a reverse -- command/software to tell me what was the last process that put computer into automatic sleep?

PS. I've done all the usual checks in the power settings and such. None were found. The system in question has some running service/process that puts it into automatic sleep after a predictable amount of time. I just need to find which one it is.
Well the place to start is in your Windows System log--look for Kernel-Power. Here's my last:

Code:
Log Name:      System
Source:        Microsoft-Windows-Kernel-Power
Date:          2/7/2016 6:54:13 AM
Event ID:      42
Task Category: (64)
Level:         Information
Keywords:      (4)
User:          N/A
Computer:      Latitude
Description:
The system is entering sleep.

Sleep Reason: System Idle

You may have to examine the events around this one as well to help you understand what happened.
 

My Computer My Computer

At a glance

Windows 7 Professional 64bitIntel Core i7 4600M @ 2.90GHz16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)Intel HD Graphics 4600 (Dell) 2048MB ATI AMD ...
Computer type
Laptop
Computer Manufacturer/Model Number
Dell Latitude E6540 Laptop
OS
Windows 7 Professional 64bit
CPU
Intel Core i7 4600M @ 2.90GHz
Motherboard
Dell Inc. 0CYT5F (SOCKET 0)
Memory
16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)
Graphics Card(s)
Intel HD Graphics 4600 (Dell) 2048MB ATI AMD Radeon HD 8790M
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
HP ZR30w (2560x1600@60Hz)
Hard Drives
256GB LITEONIT LMT-256M6M-41 mm SATA (SSD)
1TB Samsung SSD 860 EVO mSATA SATA (SSD)
2TB USB 3.0 USB Device
115GB SanDisk Ultra Fit USB
Other Info
Multiple Dell E-Port Plus II Port Replicator/Docking Stations 0Y72NH USB 3.0 + 130W AC Adapters
Thanks. That's a good start. If I go to Event Viewer -> Windows Logs -> System and then set a filter on "Kernel-Power" I get these:

The system is entering sleep.

Sleep Reason: Application API

and then if I go to Details and set XML view, I get this:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="Microsoft-Windows-Kernel-Power" Guid="{331C3B3A-2005-44C2-AC5E-77220C37D6B4}" />
<EventID>42</EventID>
<Version>2</Version>
<Level>4</Level>
<Task>64</Task>
<Opcode>0</Opcode>
<Keywords>0x8000400000000004</Keywords>
<TimeCreated SystemTime="2016-02-06T02:02:03.935384200Z" />
<EventRecordID>33360</EventRecordID>
<Correlation />
<Execution ProcessID="4" ThreadID="2344" />
<Channel>System</Channel>
<Computer>DESKTOP-69AQNQQ</Computer>
<Security />
</System>
- <EventData>
<Data Name="TargetState">2</Data>
<Data Name="EffectiveState">2</Data>
<Data Name="Reason">4</Data>
<Data Name="Flags">0</Data>
</EventData>
</Event>

The problem is that ProcessID="4" is always identified as SYSTEM. So that doesn't help much.
 

My Computer My Computer

At a glance

Windows
OS
Windows
The problem is that ProcessID="4" is always identified as SYSTEM. So that doesn't help much.
You're right, I looked at this PC and 4 is simply "System".

You said sleep occurs "after a predictable amount of time". I can only suggest that you look at the Event Logs to see if this specific timing points you at an activity.

Since Event Viewer has numerous Windows logs in it, I have found it useful to create a Custom View selecting all Event Levels and and also checking "By log" both "Windows Logs" and also "Application and Service Logs" and limiting Logged to e.g. the last hour. Then it's of a manageable length.

I think too that once the Custom View has been created you can select Properties on the right and fine-tune the params as you see fit.
 

My Computer My Computer

At a glance

Windows 7 Professional 64bitIntel Core i7 4600M @ 2.90GHz16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)Intel HD Graphics 4600 (Dell) 2048MB ATI AMD ...
Computer type
Laptop
Computer Manufacturer/Model Number
Dell Latitude E6540 Laptop
OS
Windows 7 Professional 64bit
CPU
Intel Core i7 4600M @ 2.90GHz
Motherboard
Dell Inc. 0CYT5F (SOCKET 0)
Memory
16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)
Graphics Card(s)
Intel HD Graphics 4600 (Dell) 2048MB ATI AMD Radeon HD 8790M
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
HP ZR30w (2560x1600@60Hz)
Hard Drives
256GB LITEONIT LMT-256M6M-41 mm SATA (SSD)
1TB Samsung SSD 860 EVO mSATA SATA (SSD)
2TB USB 3.0 USB Device
115GB SanDisk Ultra Fit USB
Other Info
Multiple Dell E-Port Plus II Port Replicator/Docking Stations 0Y72NH USB 3.0 + 130W AC Adapters
Thanks for the suggestion.
 

My Computer My Computer

At a glance

Windows
OS
Windows

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
The only thing that should be putting your pc to sleep is the power plan.

Set it how you want it.

Gateway:
 

Attachments

  • Capture.PNG
    Capture.PNG
    4.4 KB · Views: 9

My Computer My Computer

At a glance

Windows 10 Pro x64Intel Core i7 6700KGSkill TridentZ RGB 16GB 3600 16-16-16-36EVGA GTX 980 Ti SC x2
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Skylake Special #666
OS
Windows 10 Pro x64
CPU
Intel Core i7 6700K
Motherboard
Asus Sabertooth Z170 Mark 1
Memory
GSkill TridentZ RGB 16GB 3600 16-16-16-36
Graphics Card(s)
EVGA GTX 980 Ti SC x2
Sound Card
Realtek High Definition
Monitor(s) Displays
AOC G2460PG
Screen Resolution
1920 x 1080 144Hz
Hard Drives
Samsung 860 Pro 256GB, Seagate Barracuda 4TB x2
PSU
EVGA 1000 P2, EVGA White Custom Braided Cables
Case
Corsair Vengeance C70 Gunmetal Black
Cooling
Corsair H100i v2, Corsair ML120 x2, Thermal Grizzly Kryonaut
Keyboard
Logitech G910 Orion Spectrum
Mouse
Logitech G700s
Internet Speed
Verizon Fios Quantum Gateway 75/75
Antivirus
Windows Defender, Malwarebytes Free 3.8.3
Browser
Chrome
Other Info
Corsair SP120 x4, LG Blu-ray Drive, Durabrand HT-395 100 Watt Dolby Digital Amp, Corsair H2100 Wireless 7.1 Headset
Back
Top