Skip to content

Instantly share code, notes, and snippets.

@SeidChr
Last active January 19, 2023 11:14
Show Gist options
  • Save SeidChr/97dce721296a918cd7389a8f3e4e6aca to your computer and use it in GitHub Desktop.
Save SeidChr/97dce721296a918cd7389a8f3e4e6aca to your computer and use it in GitHub Desktop.
System Random Wakeup Issues
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# System Random Wakeup Issues"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"My computer wakes up every now and then after enabling sleep mode \n",
"Found this Forum and Thread which shows a solution\n",
"\n",
"https://answers.microsoft.com/en-us/windows/forum/all/pc-wakes-from-usb-devices/f10ac067-0131-4f56-8f53-62cd3576d3c5\n",
"\n",
"> I see. Anyway, based on what you said earlier, you found a number of devices causing this issue.\n",
"> \n",
"> Here are the steps on how to stop devices from waking your computer up from sleep mode.\n",
"> \n",
"> To stop a device from waking your Windows 10 computer up from sleep mode, open the Device Manager and double-click a device. Then click the Power Management tab and untick the box next to Allow this device to wake up the computer.\n",
"> \n",
"> 1. First, type powercfg -devicequery wake_armed into the Command Prompt. This will tell you which devices are causing your Windows 10 computer to wake up.\n",
"> \n",
"> 2. Then press the Windows key + R on your keyboard. This will cause the Run box to pop up.\n",
"> \n",
"> 3. Next, type devmgmt.msc into the search bar and click OK.\n",
"> \n",
"> 4. Select the device that’s causing your computer to wake up and double-click it. This will open up the device’s properties.\n",
"> \n",
"> 5. Then click the Power Management\n",
"> \n",
"> 6. Finally, untick Allow this device to wake up the computer and click OK.\n",
"> \n",
"> Source: https://www.hellotech.com/blog/why-does-my-comp...\n",
"> \n",
"> Best Regards,\n",
"> \n",
"> Benedict P.\n",
"> Independent Advisor\n",
"\n",
"Source is https://www.hellotech.com/blog/why-does-my-computer-keep-waking-from-sleep-mode/amp/"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Commands"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### How to get Last Wakeup Reason"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg /lastwake"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### See if there are any Wake-Timers on your PC\n",
"(Requires elevated rights / Admin)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg /waketimers"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Get all devices which can currently wake your computer\n",
"This list all devices which are currently configured to be able to wake your computer up"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery wake_armed"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Other powerconfig device queries\n",
"There are other commands which lists various different device sets"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery /?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery wake_from_any"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery wake_programmable"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery wake_from_S1_supported"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery wake_from_S2_supported"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "pwsh"
},
"polyglot_notebook": {
"kernelName": "pwsh"
}
},
"outputs": [],
"source": [
"powercfg -devicequery wake_from_S3_supported"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Additional Links\r\n",
"Control Powerstate wiht PowerCfg and Powershell: \r\n",
"https://powers-hell.com/2018/12/10/control-advanced-power-settings-with-powercfg-powershell/"
]
}
],
"metadata": {
"polyglot_notebook": {
"kernelInfo": {
"defaultKernelName": "csharp",
"items": [
{
"name": "csharp",
"aliases": [
"c#",
"C#"
],
"languageName": "C#"
},
{
"name": "fsharp",
"aliases": [
"f#",
"F#"
],
"languageName": "F#"
},
{
"name": "pwsh",
"aliases": [
"powershell"
],
"languageName": "PowerShell"
},
{
"name": "javascript",
"aliases": [
"js"
],
"languageName": "JavaScript"
},
{
"name": "html",
"aliases": [],
"languageName": "HTML"
},
{
"name": "sql",
"aliases": [],
"languageName": "SQL"
},
{
"name": "kql",
"aliases": [],
"languageName": "KQL"
},
{
"name": "mermaid",
"aliases": [],
"languageName": "Mermaid"
},
{
"name": "httpRequest",
"languageName": "http",
"aliases": []
},
{
"name": "value",
"aliases": []
},
{
"name": ".NET",
"aliases": []
},
{
"name": "vscode",
"aliases": [
"frontend"
]
},
{
"name": "webview",
"aliases": []
}
]
}
},
"custom": {
"metadata": {
"kernelspec": {
"display_name": ".NET (C#)",
"language": "C#",
"name": ".net-csharp"
},
"polyglot_notebook": {
"kernelInfo": {
"defaultKernelName": "csharp",
"items": [
{
"name": "csharp",
"languageName": "C#",
"aliases": [
"c#",
"cs"
]
},
{
"name": "fsharp",
"languageName": "F#",
"aliases": [
"f#",
"fs"
]
},
{
"name": "pwsh",
"languageName": "PowerShell",
"aliases": [
"powershell"
]
},
{
"name": "javascript",
"languageName": "JavaScript",
"aliases": [
"js"
]
},
{
"name": "html",
"languageName": "HTML",
"aliases": []
},
{
"name": "sql",
"languageName": "SQL",
"aliases": []
},
{
"name": "kql",
"languageName": "KQL",
"aliases": []
},
{
"name": "mermaid",
"languageName": "Mermaid",
"aliases": []
},
{
"name": "httpRequest",
"languageName": "http",
"aliases": []
},
{
"name": "value",
"aliases": []
}
]
}
}
}
},
"kernelInfo": {
"defaultKernelName": null,
"items": [
{
"name": "csharp",
"languageName": "C#",
"aliases": [
"c#",
"cs"
]
},
{
"name": "fsharp",
"languageName": "F#",
"aliases": [
"f#",
"fs"
]
},
{
"name": "pwsh",
"languageName": "PowerShell",
"aliases": [
"powershell"
]
},
{
"name": "javascript",
"languageName": "JavaScript",
"aliases": [
"js"
]
},
{
"name": "html",
"languageName": "HTML"
},
{
"name": "sql",
"languageName": "SQL"
},
{
"name": "kql",
"languageName": "KQL"
},
{
"name": "mermaid",
"languageName": "Mermaid"
},
{
"name": "httpRequest",
"languageName": "http"
},
{
"name": "value"
}
]
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment