Skip to content

Instantly share code, notes, and snippets.

@cptSwing
Created August 8, 2025 10:46
Show Gist options
  • Select an option

  • Save cptSwing/d0abc0905fc14b6537538e21e5173197 to your computer and use it in GitHub Desktop.

Select an option

Save cptSwing/d0abc0905fc14b6537538e21e5173197 to your computer and use it in GitHub Desktop.
Set different DPI scaling values for extra monitors attached to a laptop, while keeping the laptop's. Requires "SetDPI" (see link below)
@echo off
@REM path to SetDPI.exe (get from https://github.com/imniko/SetDPI)
set SETDPI_PATH="C:\ProgramData\SetDpi"
@REM How many screens connected?
for /f "delims=" %%a in ('powershell -Command "$m = Get-PnpDevice -Class Monitor -Status OK | measure; $m.Count"') do set "MONITOR_COUNT=%%a"
echo Monitor count : %MONITOR_COUNT%
for /l %%i in (2, 1, %MONITOR_COUNT%) do (
echo Monitor %%i set to scaling 100
start "" "%SETDPI_PATH%\SetDpi.exe" "100" "%%i"
)
@REM Show for 10 seconds
@timeout /t 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment