Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to change Windows (7) monitors settings via script

i bought a new TV mainly as second monitor to my PC and I often need to change settings (extend display for movies, duplicate display for gaming, disable for work'n'browsing).

Is there a way to switch among those settings via some script (batch most likely or VBS, whatever) so I dont't need to crawl through GUI all the time? I am veeery lazy... Thanks

like image 571
Maddog Avatar asked Sep 08 '12 08:09

Maddog


People also ask

How do I switch monitors in CMD?

You can use DisplaySwitch.exe /internal to change the display settings to use only your primary monitor, and DisplaySwitch.exe /extend to switch back to your multi-monitor setup.

How do I reassign a monitor number?

Settings ->System, select Display in the left pane. Click Advanced display settings link. Then click and drag one of the monitors to its correct location. The Identity numbers don't matter.


2 Answers

You can make a scrip with choose like i did:

@ECHO OFF
CLS
ECHO 1.Monitor 2 i TV Duplicate
ECHO 2.Monitor 2 i Monitor 3 Extended
ECHO 3.Monitor 2 i TV Extended
ECHO.

CHOICE /C 123 /M "Izbor:"

IF ERRORLEVEL 3 GOTO Mon2TvExt
IF ERRORLEVEL 2 GOTO Mon2Mon3Ext
IF ERRORLEVEL 1 GOTO Mon2TvDupl

:Mon2TvDupl
ECHO 1.Monitor 2 i TV Duplicate

Duplicate Display
DisplaySwitch.exe /clone

GOTO End

:Mon2Mon3Ext
ECHO 2.Monitor 2 i Monitor 3 Extended

DisplaySwitch.exe /external

GOTO End

:Mon2TvExt
ECHO 3.Monitor 2 i TV Extended

Extend Display
DisplaySwitch.exe /extend

GOTO End

Pause

The TV is number 1, and two monitors are number 2 and number 3.

like image 163
Dado Avatar answered Nov 16 '22 02:11

Dado


Firstly, not sure if you know the shortcut

Windows + P

2 buttons seems pretty easy!

but, you could write a batch file to run the programs with the appication displayswitch.exe included. displayswitch comes with windows 7 so you can have a batch file with:

DisplaySwitch.exe /external
notepad.exe

then use this batch file to open notepad and it will always open and switch to the external display only.

the following options are available:

Extend Display
DisplaySwitch.exe /extend

2nd monitor
DisplaySwitch.exe /external

Computers Monitor
DisplaySwitch.exe /internal

Duplicate Display
DisplaySwitch.exe /clone

Martyn

like image 29
SmithMart Avatar answered Nov 16 '22 02:11

SmithMart