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:


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
/clone 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


  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!

  5. Milan says:

    How i can disconnect projector with command prompt?

  6. Anders says:

    And for those with multiple monitors – if you have desktop extended to all monitors, initially, Win+P will give you options PC screen only (main), Extend (all), and Second screen only ( all but main ).

    In my experience, games are horrible at handling multi display setups. This will easy the pain alot, when certain games are to be fired up!!

  7. Bernard says:


    typo in the text has it as /clond

    But works a charm

  8. Markos says:

    Thanks dude!
    Also may I suggest https://www.nirsoft.net/utils/multi_monitor_tool.html
    it can turn off some monitors! not put in powersave, completely turn off!

Leave a Reply

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