Automate Dual Monitor Setup In Vista


I use a laptop as my primary workstation. Sometimes I work alone on it, but a significant portion of the time, I’m at my office desk and I hook up an external monitor to increase my workspace.

Every time I perform this action, I click the same dialog boxes in Windows Vista to setup the dual screen and position the window. It seems like a repeatable task that I could automate.

I’d like to be able to plug in my monitor cable, double click a program and have it automatically configure the monitor.

What type of program could do this? I haven’t found much online that relates. I’m thinking of trying an autohotkey script, or the Windows Accessibility API with PowerShell. Has this problem already been solved?

Clarification: I’m specifically looking to automate the steps I use with my mouse that invoke the base functionality in Windows Vista.

  1. Right click on desktop
  2. Select Personalize in context menu
  3. Click display settings
  4. Click monitor #2, then click checkbox to “Extend desktop to this monitor”
  5. Click and drag monitor #2 to the left of monitor #1
  6. Click OK to close the dialog
  7. Click Yes in the subsequent pop up to accept these monitor settings

Update: Windows 7 does this automatically

I just upgraded to Windows 7 and it remembered my dual monitor settings. I set them once at work as listed above, then unplugged and worked at home over the weekend. I came in on Monday morning, booted up, plugged in and whammo! It just worked. Thanks Windows 7!


Here I am, three years later, answering my own question! Yay!!!

This is easily scripted with

Here’s an example script for swapping between one monitor and two monitors with Windows+1 and Windows+2. AutoHotKey also allows for click and drag behavior that would be needed to swap the position of the second monitor.


Automate Dual Monitor Setup In Vista by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply