Automate Display Switching: Stream Deck, AutoHotkey and Batch Recipes
Once your profiles exist, the tray menu is the slowest way to use them. These recipes put profile switching on a Stream Deck button, behind your own AutoHotkey keys, or inside Task Scheduler — all built on the same command-line call.
The One Building Block Everything Uses
Every recipe in this article does a single thing: it runs Monitor Profile Switcher’s command-line executable with a profile to load. The exact syntax — the -load: switch, the absolute-path rule, and where -debug goes when you troubleshoot — is documented in the command-line guide, and we will not repeat it here. What follows is about the launchers: the buttons, scripts, and schedules that fire that command at the right moment.
Three standing rules apply to every recipe. Use absolute paths everywhere — a profile path that works in your test may silently fail from a scheduler or a button if it is relative. Keep MonitorSwitcher.exe and MonitorSwitcherGUI.exe together in one permanent folder (install from the download page and move the folder out of Downloads). And test each recipe by hand, from Explorer, before you automate it — automation faithfully amplifies whatever it is given, including mistakes.
Recipe 1: A Stream Deck Button That Runs a Batch File
The most reliable Stream Deck setup needs no plugins. First, create a small batch file for the profile — for example Load-Gaming.bat — that changes to the MonitorSwitcher folder and calls MonitorSwitcher.exe -load: with your Gaming profile’s full path, exactly as in the launcher pattern from the game-launch automation guide. Then:
- In the Stream Deck software, drag the System → Open action onto a key. Per Elgato’s own documentation, Open launches an application, file, or folder using the operating system’s default handling — which for a
.batfile means Windows runs it. - Click the action’s file field and select your
Load-Gaming.bat, or drag the file straight onto the key. - Give the key a title such as Gaming and an icon you will recognise in the dark.
- Repeat with a second key for your everyday profile — Desktop or Work — pointed at its own batch file.
Why route the button through a batch file instead of pointing it at the executable? Because the built-in Open action opens a file; it is not a place to type command-line arguments. The batch file carries the argument — the profile path — so the button stays simple and the logic stays in a text file you can read and fix.
Recipe 2: A Multi Action for the whole routine
A Stream Deck Multi Action runs several actions from one key, in order. A useful sequence for sitting down to play:
- System → Hotkey set to your Monitor Profile Switcher profile hotkey (this needs the MPS GUI running, since its hotkeys only work then — see the hotkey guide).
- System → Hotkey set to your audio switch, if you use one. SoundSwitch, for example, switches the playback device with a configurable hotkey — its documentation lists
Ctrl+Alt+F11as the default — so a multi action can move sound to the TV or headset in the same press that moves the picture. - System → Open Application (or Open) for the game itself.
One caution about toggles: a two-profile toggle button is tempting, and Stream Deck even offers a Hotkey Switch action that alternates between two hotkeys. But neither the deck nor Monitor Profile Switcher tracks which profile is currently active, so a toggle desynchronises the first time you switch profiles any other way. Two plainly labelled keys — one per profile — never lie about what they will do.
Recipe 3: AutoHotkey v2 — Your Own Profile Keys, Anywhere
AutoHotkey gives you what the built-in hotkeys cannot: keys that exist only in a certain app, keys that run a whole sequence, and a script that lives in your startup folder and is simply always there. Everything below is AutoHotkey v2 syntax, written against its official documentation: Run takes the full command line as a string, with the executable and any spaced paths wrapped in double quotes.
#Requires AutoHotkey v2.0
#SingleInstance Force
workCmd := '"C:\Tools\MonitorSwitcher\MonitorSwitcher.exe" -load:"C:\Users\YourName\AppData\Roaming\MonitorSwitcher\Profiles\Work.xml"'
gamingCmd := '"C:\Tools\MonitorSwitcher\MonitorSwitcher.exe" -load:"C:\Users\YourName\AppData\Roaming\MonitorSwitcher\Profiles\Gaming.xml"'
F8::Run(workCmd) ; Work profile, from anywhere
F9::Run(gamingCmd) ; Gaming profile, from anywhere
#HotIf WinActive("ahk_exe ExampleGame.exe")
F10::Run(gamingCmd) ; Only exists while that game is the active window
#HotIf
- Replace the example paths with your MonitorSwitcher folder and your real profile XML files (defaults live under
%USERPROFILE%\AppData\Roaming\MonitorSwitcher\Profiles), andExampleGame.exewith a real game’s executable name. - The bare
#HotIfat the end matters. It closes the context block; without it, every hotkey defined below that line would also become game-only. - Understand what the context hotkey is for.
#HotIf WinActive(...)gates when a hotkey exists — it does not detect a launch. TheF10key above is a panic/reset key you can press while the game is focused to re-apply its profile. Detecting a launch and reacting to it is a different job, covered by the methods in auto-switching on game launch. - Make it permanent by putting a shortcut to the
.ahkfile in your Windows startup folder, so the keys are live from sign-in.
Recipe 4: Task Scheduler — Profiles on Logon and Unlock
Some switches are not about games at all; they are about the machine returning to a known state. Task Scheduler can run the same -load: command on a schedule event:
- Open Task Scheduler and choose Create Task. On the General tab, name it after the profile it loads.
- On the Triggers tab, add At log on for a “always start in my Desktop profile” rule — or On workstation unlock for a “restore my layout whenever I come back” rule. Unlock is the interesting one: it pairs naturally with the sleep-and-wake layout problems covered in Windows forgets your monitor layout after sleep, where that guide discusses the same unlock trigger from the troubleshooting side.
- On the Actions tab, add Start a program: the program is
MonitorSwitcher.exe, the argument is-load:"C:\path\to\Desktop.xml"with your real absolute path, and the Start in field is the folder containing the executable. - If your displays are slow to wake, add a short delay to the trigger so the task fires after the monitors have enumerated, not before.
Keep scheduler tasks modest: one profile, one event, tested manually first. A task that loads a profile at unlock is a comfort; a web of interlocking tasks is a future troubleshooting session.
Safety Notes Before You Automate Anything
- Never automate a profile you have not loaded by hand. Load it from the tray first and watch it succeed; only then give it a button, a key, or a schedule.
- Keep one untouched escape profile. Your everyday Desktop profile is the way back from every experiment. Do not edit it casually, and know that a truly bad switch — all screens gone — is recoverable via the Safe Mode recovery guide.
- Absolute paths, always. Most “my automation stopped working” reports are a relative path, a moved folder, or a profile renamed in Explorer. The command line cannot load what it cannot find.
- One change at a time. Add the button, test it, then add the audio step, test again. When something breaks, you will know which layer did it.
Automated well, display switching disappears as a task entirely: a button when you sit down to play, a key when you go back to work, a quiet task that tidies up after sleep. The profiles do the remembering; the recipes just press the button for you.
Related Guides
- Monitor Profile Switcher command-line guide — the -load, -save and -debug syntax underneath every recipe here.
- Auto-switch your display profile when a game launches — batch launchers, Steam caveats, and tools with real launch triggers.
- Switch display profiles with a hotkey — the built-in per-profile hotkeys that the Stream Deck multi action uses.
