Skip to content

Instantly share code, notes, and snippets.

@book000
Created January 27, 2023 01:11
Show Gist options
  • Save book000/c5568576083a33818445bdf408b075c1 to your computer and use it in GitHub Desktop.
Save book000/c5568576083a33818445bdf408b075c1 to your computer and use it in GitHub Desktop.
imniko/SetDPI でWindowsディスプレイの拡大率設定を 100% にしたうえで RDP する bat
@echo off
echo [INFO] SetDPI 100
SetDPI.exe 1 100
echo [INFO] Connect RDP
start C:\Windows\System32\mstsc.exe "C:\Users\Tomachi\ICHIGO-MULTI-REMOTE.rdp"
timeout /T 10 /NOBREAK
:check
echo [INFO] Checking...
tasklist /V /FI "IMAGENAME eq mstsc.exe" /FI "STATUS eq RUNNING" | find "mstsc.exe"
if "%ERRORLEVEL%" == "0" (
timeout /T 5 /NOBREAK
goto check
)
echo [INFO] Set DPI 125
SetDPI.exe 1 125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment