For Windows 11 use this command (there should not be a space after the number):
DisplaySwitch 4
Numbers:
1 = /internal
2 = /clone
3 = /extend
4 = /external
For Windows 10 use this command:
DisplaySwitch.exe /external
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have two displays connected to my PC, running Windows 11 Home. I use just the primary display most of the time but need to switch on my secondary display whenever I'm running a VM or need more screen estate.
For years, I've used DisplaySwitch.exe in conjunction with AutoHotKey to quickly switch between different display configurations. Here's the relevant snippet of my configuration:
^!1::
; Ctrl+Alt+1 = Display 1
Run, %A_WinDir%\System32\DisplaySwitch.exe /internal
return
^!2::
; Ctrl+Alt+2 = Display 2
Run, %A_WinDir%\System32\DisplaySwitch.exe /external
return
^!3::
; Ctrl+Alt+3 = Display 1+2
Run, %A_WinDir%\System32\DisplaySwitch.exe /extend
return
Today, I installed the 22H2 (build 22621.521) update and suddenly, those shortcuts stopped working. Now, pressing any of those key combinations pops up the Project window:
Apparently, DisplaySwitch.exe no longer accepts the /internal, /external and /extend switches.
Is there an alternative method to get this working again?
Thanks for your time.
For Windows 11 use this command (there should not be a space after the number):
DisplaySwitch 4
Numbers:
1 = /internal
2 = /clone
3 = /extend
4 = /external
For Windows 10 use this command:
DisplaySwitch.exe /external
In case someone arrives here looking for a solution to a similar problem, I managed to solve it by copying DisplaySwitch.exe from a Windows 10 installation to a different location, and using that instead of the inbuilt DisplaySwitch.exe.
My modified AHK config is:
^!1::
; Ctrl+Alt+1 = Display 1
Run, "D:\Software\Display Switch\DisplaySwitch.exe" /internal
return
^!2::
; Ctrl+Alt+2 = Display 2
Run, "D:\Software\Display Switch\DisplaySwitch.exe" /external
return
^!3::
; Ctrl+Alt+3 = Display 1+2
Run, "D:\Software\Display Switch\DisplaySwitch.exe" /extend
return
How incompetent can someone be... I have the same problem with Windows 11. Can anyone provide the displayswitchexe from Windows 10 please through a dropbox share or some other way, with a sha256 hash multiple people can confirm is the correct one. thanks
here is a version someone shared from windows 10, it has digital signatur by windows, so that is safe:
also theory in reddit post is, the cause of this problem is, they changed the exe to UWP app, and obviously that is missing arguments, same as switching to notepad.exe to UWP app which is totally 1000 times slower and buggy as hell.
MS is a joke.
Finally, I created a Windows Forms app using the .NET Framework. I replaced the code in the Program.cs file and built the executable (exe) file by running the build command. To execute the extend/duplicate functionality, simply run 'switchDisplay.exe with extend' or 'switchDisplay.exe with duplicate'.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace switchDisplay
{
internal static class Program
{
[Flags]
public enum SetDisplayConfigFlags : uint
{
SDC_TOPOLOGY_INTERNAL = 0x00000001,
SDC_TOPOLOGY_CLONE = 0x00000002,
SDC_TOPOLOGY_EXTEND = 0x00000004,
SDC_TOPOLOGY_EXTERNAL = 0x00000008,
SDC_APPLY = 0x00000080
}
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
private static extern long SetDisplayConfig(uint numPathArrayElements,
IntPtr pathArray, uint numModeArrayElements, IntPtr modeArray, SetDisplayConfigFlags flags);
static void CloneDisplays()
{
SetDisplayConfig(0, IntPtr.Zero, 0, IntPtr.Zero, SetDisplayConfigFlags.SDC_TOPOLOGY_CLONE | SetDisplayConfigFlags.SDC_APPLY);
}
static void ExtendDisplays()
{
SetDisplayConfig(0, IntPtr.Zero, 0, IntPtr.Zero, SetDisplayConfigFlags.SDC_TOPOLOGY_EXTEND | SetDisplayConfigFlags.SDC_APPLY);
}
static void ExternalDisplay()
{
SetDisplayConfig(0, IntPtr.Zero, 0, IntPtr.Zero, SetDisplayConfigFlags.SDC_TOPOLOGY_EXTERNAL | SetDisplayConfigFlags.SDC_APPLY);
}
static void InternalDisplay()
{
SetDisplayConfig(0, IntPtr.Zero, 0, IntPtr.Zero, SetDisplayConfigFlags.SDC_TOPOLOGY_INTERNAL | SetDisplayConfigFlags.SDC_APPLY);
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length > 0)
{
string parameter = args[0].ToLower();
if (parameter == "extend")
{
ExtendDisplays(); // Set the display mode to extend
}
else if (parameter == "duplicate")
{
CloneDisplays(); // Set the display mode to duplicate
}
else
{
MessageBox.Show("Invalid parameter. Please provide either 'extend' or 'duplicate'.");
}
}
else
{
MessageBox.Show("No parameter provided. Please provide either 'extend' or 'duplicate'.");
}
}
}
}
Hello there,
In most cases, DisplaySwitch.exe file problems are due to the file missing or being corrupted (malware / virus). See if you can repair it by running a system file fix then an image repair. Here's how:
Run System File Checker
Run windows image fix.
--------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--