Disable/Enable 2nd/3rd monitor programmatically. (Win10)

6

3

How can I disable a monitor programmatically. From the display settings dialog I can set a monitor to be either a duplicate of another monitor, an extension of the normal desktop or "Disconnected".

Can this be done with powershell or some scripting language like autoit, I'm comfortable with using C# if I need to? I need to be able to run a program and make the 3rd monitor disconnected or enable it as an extension of the desktop.

Example

Beige The Color

Posted 2017-05-29T16:45:36.887

Reputation: 106

Question was closed 2017-05-29T17:30:59.140

I think this is what you're looking for: https://stackoverflow.com/questions/275063/extend-my-windows-desktop-onto-this-monitor-programmatically

– fernando.reyes – 2017-05-29T17:10:35.873

Answers

4

How can I disable a monitor programmatically?

You can use the MultiMonitorTool by Nirsoft:

MultiMonitorTool is a small tool that allows you to do some actions related to working with multiple monitors. With MultiMonitorTool, you can disable/enable monitors, set the primary monitor, save and load the configuration of all monitors, and move windows from one monitor to another. You can do these actions from the user interface or from command-line, without displaying user interface. MultiMonitorTool also provides a preview window, which allows you to watch a preview of every monitor on your system.

System Requirements and Limitations

  • This utility works on any version of Windows, starting from Windows XP and up to Windows 10. Both 32-bit and x64 systems are supported.
  • This utility is only useful if your desktop is extended to multiple monitors. If you have multiple monitors that display the same content, then is useless for you.

...

Command-Line Options

You can use the following command-line options to change the monitor configuration or to move windows automatically without displaying any user interface.

The <Monitor> parameter in all command-line options may contain the following values:

  • Primary - Specifies that you want to do the action on the primary monitor.
  • Monitor Name, as it appears in the 'Name' column, for example: \\.\DISPLAY1 , \\.\DISPLAY2, \\.\DISPLAY3
  • Monitor Number - The number that appears in the monitor name. (1 for \\.\DISPLAY1, 2 for \\.\DISPLAY2, and so on...)
  • Monitor ID, as it appears in the 'Monitor ID' column, for example: MONITOR\GSM59A4\{4d36e96e-e325-11ce-bfc1-08002be10318}\0008

/disable <Monitors> - Disables the specified monitors. You can specify a single monitor or multiple monitors.

Examples:

MultiMonitorTool.exe /disable 1
MultiMonitorTool.exe /disable \\.\DISPLAY3
MultiMonitorTool.exe /disable 1 2 3 

/enable <Monitors> - Enables the specified monitors.

Examples:

MultiMonitorTool.exe /enable 3
MultiMonitorTool.exe /enable \\.\DISPLAY1
MultiMonitorTool.exe /enable 3 2

Source MultiMonitorTool.

There are more MultiMonitorTool commands. See the source link above for more information.


Disclaimer

I am not affiliated with nirsoft in any way, I am just an end user of their software.

DavidPostill

Posted 2017-05-29T16:45:36.887

Reputation: 118 938