Forum Discussion
A script to wake up monitors
You’ve explained what you need clearly. If only the monitors are asleep and Windows is still running, this script can usually wake them by moving the mouse pointer slightly and then moving it back. It doesn’t click anything.
Open Notepad and paste this:
Add-Type @'
using System.Runtime.InteropServices;
public static class WakeDisplay {
[DllImport("user32.dll")]
public static extern void mouse_event(
uint flags, int dx, int dy, uint data, UIntPtr extraInfo);
}
'@[WakeDisplay]::mouse_event(1, 1, 0, 0, [UIntPtr]::Zero)
Start-Sleep -Milliseconds 100
[WakeDisplay]::mouse_event(1, -1, 0, 0, [UIntPtr]::Zero)
Save it as WakeMonitors.ps1, choosing All files as the file type.
Create a shortcut with this target, replacing the example path with wherever you saved the script:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\YourFolder\WakeMonitors.ps1"
Name the shortcut Wake Monitors and pin it to the taskbar, like your existing shortcuts. Try your usual “click Wake Monitors” voice command while the displays are off.
The important limitation: this cannot wake the whole computer from sleep, because neither the script nor Windows voice control can run while the PC is asleep.