A simple keyboard/desktop shortcut Powershell script to turn off the monitor(s).
Download the zip archive from the latest release or follow the DIY instructions below.
- In Windows, right click the desktop and choose New > Shortcut.
- In the window that appears, put the following code in the box for the location of the item, then click next:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command "(Add-Type '[DllImport(\"user32.dll\")]public static extern int SendMessage(int hWnd,int hMsg,int wParam,int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)"
- Now name the shortcut (e.g. TurnOffMonitor), then click Finish. At this stage, you will have created a desktop shortcut that turns off the monitor(s).
- Right click on the desktop shortcut you created and open Properties.
- Click inside the "Shortcut key" textbox (where it says "None" if you haven't already created a keyboard shortcut; if you have already then it will show it).
- Press your desired key combination (e.g. Ctrl + Alt + N), then click Apply. You will now be able to press the key combination you set to turn of the monitor(s).
- The shortcut must remain on the desktop in order to work.
- Keyboard shortcut has limitations. Follow Ctrl + Alt + KEY format for best results.