Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / PowerShell / Windows: How to Turn Off Monitor with Command Line

February 17, 2025

Windows: How to Turn Off Monitor with Command Line

Windows can automatically turn off your monitor when it is not in use. On laptops, turning off the display can have a positive effect on power consumption and battery life. When running some long tasks or scripts, you may want to turn off the display to save power. Let’s explore how to turn off the monitor in Windows using the command line, a shortcut, or a keyboard hotkey.

To find out the time after which the screen automatically turns off, open the Power Plan settings in the Control Panel GUI ( control.exe powercfg.cpl,,3 ) or use the command:

powercfg /q

powercfg - get auto turnoff display timeout

 Subgroup GUID: 7516b95f-f776-4464-8c53-06167f40cc99 (Display)
GUID Alias: SUB_VIDEO
Power Setting GUID: 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e (Turn off display after)
GUID Alias: VIDEOIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x000004b0
Current DC Power Setting Index: 0x0000012c

In this example, the screen will automatically turn off after 20 minutes when the AC is powered ( 0x000004b0 in HEX).

Turn off display in Power options

You can adjust the screen turn-off time in the current power scheme while running on AC power by using the command:
powercfg -change -monitor-timeout-ac 5
or set the timeout for turning off the display while the device is running on battery:
powercfg -change -monitor-timeout-dc 5

You can turn off the display in Windows by using PowerShell. Execute this command to turn off the display immediately:

Press Win + R ->and run:
cmd.exe /c powershell (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)

You can create a desktop shortcut to quickly turn off the monitor:

  1. Right-click on the desktop and select New -> Shortcut; create desktop shortcut
  2. Specify this command in the shortcut properties: cmd.exe /c powershell (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) turn off screen with PowerShell
  3. Set the shortcut name;
  4. You can assign a hotkey to a shortcut to perform it quickly (shortcut properties -> Shortcut Key -> specify the keyboard shortcut -> in my example it is Ctrl + Shift + D ) assign a keyboard shortcut to turn off monitor

Now, to turn off the display, click the shortcut on the desktop or press a keyboard hotkey.

If you have more than one monitor connected to your computer, you may want to turn off only one (specific) monitor. This can be done using the ControlMyMonitor utility from NirSoft. (https://www.nirsoft.net/utils/control_my_monitor.html).

Run the tool to list the available monitors, and then use Ctrl+M to copy the device path of the monitor you need.

How to turn off or turn on a specific PC monitor with ControlMyMonitor

To power off a specific monitor from the command prompt, run:

ControlMyMonitor.exe /TurnOff "\\.\DISPLAY2\Monitor0"

Use the second monitor’s hardware power button or the following command to turn on the second monitor:

ControlMyMonitor.exe /TurnOn "\\.\DISPLAY2\Monitor0"

0 comment
2
Facebook Twitter Google + Pinterest
PowerShellQuestions and AnswersWindows 10Windows 11
previous post
How to Configure Windows Firewall Logging and Analyze Logs
next post
Maximum Concurrent Connections Limit in Windows 10 and 11

Related Reading

How to Assign (Passthrough) a Physical GPU to...

June 11, 2024

Extend an Expired User Password in Active Directory

December 23, 2024

Adding ESXi Host to VMware vCenter Server (vCSA)

March 12, 2024

How to Add or Remove Pinned Folders to...

August 11, 2024

Check the Software Installation/Removal History in Windows

October 8, 2024

Configure File and Folder Access Auditing on Windows...

July 8, 2024

How to Create, Delete, and Manage System Restore...

March 14, 2024

How to Enable and Configure Wake-on-LAN (WoL) in...

April 1, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Run PowerShell Scripts on a Schedule with Task Scheduler
  • How to Assign (Passthrough) a Physical GPU to a Hyper-V Virtual Machine
  • Extend an Expired User Password in Active Directory
  • Check Windows 11 Hardware Readiness with PowerShell Script
  • How to Enable and Configure Wake-on-LAN (WoL) in Windows
  • How to Find Windows Version and Build Number Installed
  • Check the Software Installation/Removal History in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top