Something from Google might be useful this is what I do to swap screen formats and retain desktop icons.
============================
Monitor shortcuts you can put on both screens.
Right-click on your desktop and select New > Shortcut.
In the "Type the location of the item" box, copy and paste one of the following:
For TV Only (Single Monitor):
DisplaySwitch.exe /external
For Sim Rig Only (Primary):
DisplaySwitch.exe /internal
To go back to Dual Screen:
DisplaySwitch.exe /extend
I then use numbered ICO of different colours is easy to see across room
===================================================
To achieve a true swap of the primary monitor, you must use third-party tools like NirCmd or MultiMonitorTool in your batch file, or use a toggle script based on DisplaySwitch.exe.
Method 1: Using NirCmd (Recommended)
This method uses the lightweight tool NirCmd to set the primary monitor by its ID.
Download NirCmd and place nircmd.exe in C:\Windows\ so it runs from anywhere.
Open Notepad, paste the following code, and save it as SwapMonitors.bat.
Note: You may need to change 2 to 1 or 3 depending on which monitor is your secondary.
batch
@echo off
:: Use NirCmd to set the second monitor (ID 2) as primary
nircmd.exe setprimarydisplay 2
Method 2: Toggle Primary Monitor (No Third-Party Tools)
If you cannot install third-party tools, you can use a "toggle" batch file. This script creates a temporary file (monitor.flg) to remember which state was active and switches to the other.
Super User
Super User
batch
@echo off
Setlocal
:: Define a temporary file in the Temp folder
set "myFlag=%temp%\monitor.flg"
if Exist "%myFlag%" (
rem If flag exists, make laptop screen primary
echo Switching to internal display...
DisplaySwitch.exe /internal
del /q "%myFlag%"
) else (
rem If flag does not exist, make external screen primary
echo Switching to external display...
DisplaySwitch.exe /external
echo.>"%myFlag%"
)
Method 3: Using MultiMonitorTool (For Complex Setups)
If you have a complex setup (resolutions, positions), use MultiMonitorTool to save configuration profiles.
Super User
Super User
Set up your display configuration exactly how you want it via Windows Display Settings.
Open MultiMonitorTool, select all monitors, and save the configuration (e.g., set1.cfg).
Set up the opposite display configuration and save it (e.g., set2.cfg).
Create a batch file to toggle between them:
batch
@echo off
:: Replace paths with actual locations of your .cfg files
"C:\Path\To\MultiMonitorTool.exe" /LoadConfig "C:\Path\To\set1.cfg"
================================
ADDING Reicon Batch Files
Since you have ReIcon and are already setting up display shortcuts, you can combine them into a single Batch file (.bat). This will allow you to switch monitors and automatically restore your icon positions with one click.
Step 1: Find the Command Line Path for ReIcon
ReIcon supports command line arguments that let you restore a specific layout without opening the interface.
Open your ReIcon folder.
Note the name of your preferred layout (e.g., "Sim_Layout" or "TV_Layout").
Step 2: Create a "Switch and Restore" Batch File
Instead of just a shortcut to DisplaySwitch.exe, you can create a small script.
Open Notepad.
Paste the following code (adjust the paths to where you saved ReIcon):
batch
@echo off
:: Switch to TV (Secondary Monitor)
%windir%\System32\DisplaySwitch.exe /external
:: Wait 3 seconds for the monitor to handshake
timeout /t 3 /nobreak > nul
:: Restore your specific ReIcon layout
"C:\Path\To\ReIcon_x64.exe" /R "TV_Layout"
Use code with caution.
Save as SwitchToTV.bat on your desktop.
Repeat this for your Sim Rig, using /internal for the display switch and your Sim layout name for ReIcon.
======================================