This repo provides:
display_config.bat
— Predefined monitor layouts using NirSoft MultiMonitorTool.RustDeskWatcher.ps1
— A PowerShell script that tails RustDesk server logs and triggers monitor configs automatically:- On RustDesk connect →
display_config.bat config2
- On RustDesk disconnect →
display_config.bat config1
- On RustDesk connect →
RustDeskWatcherTask.xml
— Importable Scheduled Task that runs the watcher at boot.
- Quickly switch between monitor configs from the menu or command-line.
- Auto-switch layout when RustDesk sessions start/end.
- Lightweight, no external dependencies beyond MultiMonitorTool + PowerShell.
Three monitor switch/
├── display_config.bat
├── MultiMonitorTool.exe
├── RustDeskWatcher.ps1
├── RustDeskWatcherTask.xml
└── RustDeskWatcher.log # created at runtime
RustDesk server logs are tailed from:
C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\log\server
display_config.bat
defines 4 monitor layouts:
- config1 — All monitors (restores baseline)
- config2 — Only Monitor 3 at 1680×1050
- config3 — Monitor 1 + 3 only
- config4 — Only Monitor 3 at 1920×1080
Run directly from the command line:
display_config.bat config1
display_config.bat config2
display_config.bat config3
display_config.bat config4
Run with no arguments to get an interactive menu.
Copy these into:
C:\Users\mail\Documents\000 Development\Three monitor switch
display_config.bat
MultiMonitorTool.exe
RustDeskWatcher.ps1
RustDeskWatcherTask.xml
Open an Admin PowerShell or CMD:
schtasks /Create /TN "RustDeskWatcher" /XML "C:\Users\mail\Documents\000 Development\Three monitor switch\RustDeskWatcherTask.xml" /F
Start it immediately (without reboot):
schtasks /Run /TN "RustDeskWatcher"
- Connect via RustDesk → layout switches to config2.
- Disconnect → layout reverts to config1.
Logs are written to:
RustDeskWatcher.log
The watcher looks for these strings in RustDesk logs:
- Connect:
Connection opened
- Disconnect:
Connection closed
If your RustDesk version uses different wording, update $ConnectRegex
/ $DisconnectRegex
in RustDeskWatcher.ps1
.
- Error
SUBSCRIBER_EXISTS
→ The script is already running. Use Task Scheduler instead of starting it twice manually. - MultiMonitorTool.exe not found → Place it in the same folder as
display_config.bat
. - Different monitor IDs → Dump your mapping:
MultiMonitorTool.exe /stext monitors.txt
Update \\.\DISPLAYx
in the batch file accordingly.
MIT License
- Batch + watcher integration: Rob
- Multi-monitor control: NirSoft MultiMonitorTool