Switch your display through the command line

In Windows 7 Microsoft has introduced a very nice feature, the ability to extend/duplicate your desktop to an external screen.
In Windows XP I found it to be very, very annoying whenever I had to use a laptop when presenting that wasn’t mine since every single vendor had their own shortkeys for switching to an extenal screen. But this was only to duplicate the to the external screen… when you wanted to extend the desktop, you had to open the screen properties in Windows and select that… bloody annoying.

And then there was Windows 7. Just by pressing “WinKey + P” you would get the screen below:

image

Very easy and user friendly, me like!

Now, this afternoon I was at one of my customers which is a school for higher education. They decided to attach a second monitor to all the computers in the science department.
But the ‘issue’ was that a manual action was required to extend the screen to the second screen.

What they didn’t knew was that the screen as shown in the screenshot above can be called through the command “displayswitch.exe”… and it has parameters! Specifically…

Parameter Description
/internal Disconnect projector
/clond Duplicate screen
/extend Extend screen
/external Projector only (disconnect local)

So, simply by deploying this command to those devices through some kind of central method no user interaction is required Glimlach

4 comments

  1. Ian North says:

    Fantastic! I’ve been trying to work out how to do this all day and it turns out to be a simple command. Thank you for this post!

  2. Wae says:

    Thanks for posting this, even for windows 10, it still works. I create in 2 batch file and put on the desktop just for easier switch. Many thanks.

  3. Eb says:

    Forgot about the old Win key combos. I didn’t even know there was one for that too. Thanks!

  4. Big Smile says:

    Wonderful! It works like a charm!

Leave a Reply

Your email address will not be published. Required fields are marked *