If you have been troubled by the phenomenon where the PC wakes up on its own in a few seconds (or doesn’t sleep at all) even if you put the PC to sleep due to high-sensitivity gaming mice (such as Razer), network sharing, Windows Update, etc., this is a summary of logs and commands when I completely crushed the causes using PowerShell .
This is a CLI prescription for those who find it tedious to click through the GUI.
1. Checking the Current State (Identifying the Culprit)
First, check “what caused the PC to wake up most recently” and “who currently has the right to wake up the PC.”
Open PowerShell with Administrator privileges and run the following commands.
# Check the most recent wake factor
powercfg -lastwake
# Display a list of devices that currently have sleep release permission
powercfg -devicequery wake_armed
Common Culprits:
HID-compliant mouse/Razer DeathAdder...(Mouse vibration detection)Intel(R) Ethernet Controller...(Wake-on-LAN or packet reception)UpdateOrchestrator(Windows Update maintenance task)
2. Preventing Accidental Waking by Mouse/Keyboard (Razer, etc.)
High-DPI mice are judged as “operation” even by slight vibrations of the desk or wind from the air conditioner, and release the sleep. Since searching from the Device Manager is time-consuming, specify the device name and strip the permission.
# Specify a particular device and disable it (name is the one confirmed with devicequery)
powercfg -devicedisablewake "Razer DeathAdder V4 Pro"
powercfg -devicedisablewake "HID-compliant mouse"
【Recommended】 Script to disable mouse series all at once
Since Razer products, etc., sometimes create multiple “HID-compliant mice” as virtual devices, it is certain to disable them all at once. *Note that if you don”t leave the keyboard, you won”t be able to wake it up except with the power button.
# Strip sleep release permission from all pointing devices (mice, etc.)
Get-CimInstance Win32_PointingDevice | ForEach-Object {
$name="$_.Name"
Write-Host "Disabling wake for: "$name'
powercfg -devicedisablewake '$name"}
3. Preventing Waking by Network/File Sharing
If you are using media server functions or file sharing, the PC is woken up by access checks from other devices.
Disabling Network Adapters
# Prohibit release by NW adapters such as Ethernet
Get-NetAdapter | ForEach-Object {
# Disable Wake on Magic Packet / Pattern Match
Set-NetAdapterPowerManagement -Name $_.Name -WakeOnMagicPacket Disabled -WakeOnPattern Disabled
}
Setting to Sleep even during “Media Sharing”
Windows is in the “Does not sleep during media sharing (Away Mode)” setting by default. Change this forcibly to “Allow sleep.”
# Change the setting of "When sharing media" to "Allow the computer to sleep"
powercfg -setacvalueindex SCHEME_CURRENT 9596fb26-9850-41fd-ac3e-f7c3c00afd4b 03680956-93bc-4294-bba6-4e0f09bb717f 0
powercfg -setactive SCHEME_CURRENT
4. Preventing Out-of-Control Windows Update / Maintenance Tasks
Tasks such as UpdateOrchestrator may result in “Access is denied” when trying to disable from the Task Scheduler, and can”t be stopped even with administrator privileges.
Therefore, disable the usage permission of “Wake Timers” for the entire system instead of the task itself. This is the strongest solution.
# Disable sleep release timers when power is connected
powercfg -setacvalueindex SCHEME_CURRENT 238c9fa8-0aad-41ed-83f4-97be242c8f20 bd3b7180-0530-45fb-8885-af2718140a23 0
# Disable sleep release timers when on battery
powercfg -setdcvalueindex SCHEME_CURRENT 238c9fa8-0aad-41ed-83f4-97be242c8f20 bd3b7180-0530-45fb-8885-af2718140a23 0
# Reflect settings
powercfg -setactive SCHEME_CURRENT
Extra: Definitely Turning Off the Monitor with AutoHotkey
If you want to turn off the monitor immediately with Win + z, etc., there is a problem that it wakes up immediately with the signal at the moment of releasing the key. The trick is to execute after blocking the input with BlockInput.
; Monitor off with Win + z
#z::
; Temporarily block input to prevent immediate wake-up due to mouse/input
BlockInput, On
; Wait for the keys to be completely released
KeyWait, z
KeyWait, LWin
KeyWait, RWin
; Buffer for safety (waiting for mouse sensor stabilization)
Sleep, 1000
; Monitor power off (0xF170 = SC_MONITORPOWER, 2 = Off)
SendMessage, 0x112, 0xF170, 2,, Program Manager
; Release input block
BlockInput, Off
Return
Summary
- Mouse : High-sensitivity sensors wake up with vibration, so disabling is mandatory.
- Network : Sleep obstruction due to file sharing settings is often overlooked.
- Windows Update : Task disabling results in error, so contain it with
Wake Timerssetting.
With this, you are released from the mysterious phenomenon of the PC glowing on its own in the middle of the night.



![[2026 Latest] Strongest AI Coding Tool Comparison: Who Wins the Agentic AI Era?](/images/ai-coding-tools-2026.jpg)


⚠️ コメントのルール
※違反コメントはAIおよび管理者により予告なく削除されます
まだコメントがありません。最初のコメントを投稿しましょう!