Want a quick way to turn off your monitors immediately, without putting your PC to sleep? This tiny batch file does exactly that. Your screens will go dark instantly and wake back up the moment you move the mouse or hit a key.
What this does
This script sends Windows the “turn off display” command. It does not:
-
shut down your PC
-
hibernate
-
close apps
-
stop downloads, streams, or music
It only puts your display(s) to sleep until you interact again.
Step 1: Create the batch file
-
Open Notepad
-
Paste this code:
@echo off
powershell -command "(Add-Type '[DllImport(\"user32.dll\")] public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name Native -Namespace Win32 -PassThru)::SendMessage(0xFFFF,0x112,0xF170,2)"Click File -> Save As
-
Set:
-
File name:
SleepMonitors.bat -
Save as type:
All Files (*.*) -
Encoding:
UTF-8(optional, but fine)
-
-
Save it somewhere easy like your Desktop.
Step 2: Run it
Double-click SleepMonitors.bat.
Your screens should go dark immediately.
To wake them:
-
move your mouse, or
-
press any key
Optional: Make it feel like a real “button” (desktop shortcut + icon)
Create a shortcut
-
Right-click
SleepMonitors.bat -
Choose Show more options (if you’re on Windows 11’s compact menu)
-
Click Create shortcut
Assign an icon
-
Right-click the shortcut -> Properties
-
Click Change Icon
-
Browse to a
.icofile you like -
Apply/OK
Optional: Set a keyboard hotkey
-
Right-click the shortcut -> Properties
-
Click into Shortcut key
-
Press something like
Ctrl + Alt + M -
Apply
Now you can sleep the monitors instantly from the keyboard.
Icon you can use:
Troubleshooting
Nothing happens
-
Make sure you saved it as
.batand not.txt -
Ensure the file contains both lines exactly, starting with
@echo off
PowerShell warning / policy issues
This command runs a one-liner and typically works even on systems with stricter policies, but if yours is locked down, try running PowerShell as admin once, or use a different method (rundll32). Most Windows 11 systems are fine with the above.
Here is the bat file already done for you.