Change Display Arrangement via Batch/Command Line on Windows 7
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.
Big thanks to Bill Rodman's comment in this thread.
I combine this utility with the Windows7 DisplaySwitch.exe command: "C:\Windows\System32\DisplaySwitch.exe /internal" to switch exclusevely to the main monitor. – Bill Rodman Jan 29 '10 at 12:17
Testing this out, this calls and immediately selects the screen to choose via the.
- /internal calls the internal screen (your primary display)
- /external changes to the external screen (im not sure how well it handles when there is more than 1 screen)
- /clone duplicates displays.
- /extend switches to extended settings.
Since this is calling a file path, simply attach this to your batch script and baboom, instant and effective display changing. A good idea would be to string this togethor into windows Task Scheduler UI as you can call the file path, and give it the arguments, then whenever your TF2 event happens, the display will always switch.
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!
While I realize this is an old thread, toggling between display modes in Windows 10 using tools available by default is possible. The problem I ran into was there was no "clear" mechanism to tell that the display was Extended, vs. Cloned. Here is my working prototype in PowerShell:
#ext_or_clone.ps1
#Toggle between Extend and Clone displays
#requires PowerShell 3
#Load Windows Forms .Net class
#if PowerShell < 3 use this instead: [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
Add-Type -AssemblyName System.Windows.Forms
#check the width of the virtual display, the "mode" width
$currDispMode = [System.Windows.Forms.SystemInformation]::VirtualScreen.Width
#check the width of the primary display
$oneScrWidth = [System.Windows.Forms.SystemInformation]::WorkingArea.width
#compare the two widths
switch ($currDispMode)
{
#if the widths are the same,
# it means the displays are in clone mode, so the mode should be extend
$oneScrWidth{displayswitch.exe /extend}
#if the VirtualScreen width is greater than the primary screen width
# it means displays are in extend mode, so the mode should be clone
{$_ -gt $oneScrWidth}{displayswitch.exe /clone}
}