# Prompt the user for the IDs to swap $monitorID1 = Read-Host "Enter the first monitor ID to swap" $monitorID2 = Read-Host "Enter the second monitor ID to swap" # Path to the DisplayFusion taskbar settings $dfTaskbarSettingsPath = "HKCU:\Software\Binary Fortress Software\DisplayFusion\Taskbars\" # Build the paths for the current and new registry keys $firstKeyPath = $dfTaskbarSettingsPath + $monitorID1 $secondKeyPath = $dfTaskbarSettingsPath + $monitorID2 # Check if the first registry key exists and rename it to old if (Test-Path $firstKeyPath) { # Rename the registry key Rename-Item -Path $firstKeyPath -NewName $($monitorID1 + "_old") -ErrorAction Stop } else { Write-Host "Error: The specified registry key $firstKeyPath does not exist." } # Check if the second registry key exists and rename it to old if (Test-Path $secondKeyPath) { # Rename the registry key Rename-Item -Path $secondKeyPath -NewName $monitorID1 -ErrorAction Stop } else { Write-Host "Error: The specified registry key $secondKeyPath does not exist." } # Rename the first registry key to the second registry key if (Test-Path $($firstKeyPath + "_old")) { # Rename the registry key Rename-Item -Path $($firstKeyPath + "_old") -NewName $monitorID2 -ErrorAction Stop } else { Write-Host "Error: The specified registry key $($firstKeyPath + "_old") does not exist." }