Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to change the Display Arrangement of my computer via Command line. I have 2 monitors set up, extending, and I want to change the monitors setup from Dual Display to Single Display and back via command line.

I've had a look through QRes and nircmd. While QRes lacks multimonitor support entirely, nircmd cannot disable a monitor, only change the primary state and the resolution of separate screens.

It would be appreciated if you know of a way to do that.

Edit: I will post my solution here using the display changer in climenoles answer:

@echo off
REM setting to single screen
echo *** Disabling Screen 2 *** 
cd C:\Program Files (x86)\12noon Display Changer\
dc64cmd.exe -monitor="\\.\DISPLAY2" -detach

echo Starting TF2 -fullscreen -novid -console -w 1920 -h 1200
REM Starting Team Fortress 2 fullscreen
cd C:\Program Files (x86)\Steam
Steam.exe -applaunch 440 -fullscreen -novid -console -w 1920 -h 1200

REM pausing because steam.exe returns before TF2 quits
echo Press a key to reenable Screen 2
pause
cd C:\Program Files (x86)\12noon Display Changer\
dc64cmd.exe -monitor="\\.\DISPLAY2" -secondary
share|improve this question
    
Your post actually gave me the idea for this feature I added to TvGameLauncher. Check it out if still relevant (See my answer below). –  Ohad Schneider Jul 12 at 17:58

2 Answers 2

up vote 5 down vote accepted

This utility may help you: Display Changer :

«Display Changer changes the display resolution, runs a program, then restores the original settings. It can also change the resolution permanently and rearrange the monitors in a multiple-monitor setup»

Works in GUI or command line and it's free for personnal use...

http://12noon.com/?page_id=80

Hope this help. Let us know.

share|improve this answer
    
Upvote for a good answer, but it will not work that way. I am trying to launch a Steam game that way. Launching it via the "steam://rungameid/#" does not work as it gives you no executable. running steam.exe with the -applaunch # option changes the resolution, does not start the game and immediately changes back (so fast you hardly see it). running the game executable directly leads to a loading error. Nice idea, yet it didn't work. –  private_meta Feb 28 '12 at 17:42
    
But I just realized I can create a batch file with the initial command to change to one screen, start the game in a separate command line and then change back after the program terminates, all within a batch, that should theoretically work. I'll have to try that. –  private_meta Feb 28 '12 at 17:44
    
Okay. Tell us if this works for you. If the batch works well you may compile it to have an .exe file With this for example: batchcompiler.sourceforge.net :) –  climenole Feb 28 '12 at 18:14
    
Thank you. That works perfectly fine, except for the fact that steam.exe returns immediately, so I have to use "pause" or the batch won't work. –  private_meta Feb 29 '12 at 20:42

You were close with NirCmd, but what you're looking for is Nir's MultiMonitorTool:

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.

The 12noon tool looks nice, but barring an official MS tool, I'll take NirSoft over any other tool any day.

Shameless plug: You may be interested in the TvGameLauncher tool I wrote for exactly this purpose (switching primary displays for playing games). It can also switch to HDMI audio and prevent the screensaver from popping up while you're playing (without disabling it). It even supports the Steam protocol (Steam://) so you don't have to use the pause trick. It doesn't support disabling your other monitors though, but I'll add that to my todo list (I have some other cool features coming up like automatic TV shortcut generation).

Edit - all features added. Check it out!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.