How can I enable/disable monitors from the command-line?

Solution 1:

With the freeware MultiMonitorTool it's quite easy:

MultiMonitorTool.exe /disable 1
MultiMonitorTool.exe /enable 2 3
MultiMonitorTool.exe /switch 3
MultiMonitorTool.exe /disable \\.\DISPLAY2

Solution 2:

You can use devcon to do that (you will need to determine your hardware ID, probably here: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY

http://support.microsoft.com/kb/311272

If you need a 64-bit version, you can get it in the Windows Driver Kit:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11800

http://www.techlikes.com/2010/09/25/devcon-problem-in-windows-7-solved.html# (for some usage issues).