Change “Windows font size (DPI)” in PowerShell?

后端 未结 7 2021
别那么骄傲
别那么骄傲 2020-12-08 17:20

I\'m using a laptop at office (Windows 7) with a station and double screen and at home without station.

The point is I have to change text size each time I switch fr

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 17:46

    After much time, I can't find anything in google. Well, I made my own script:

    $perfis = (Get-ChildItem Registry::HKEY_USERS\ | Where-Object {$_.Name -match "S-1"} | ForEach-Object {Get-ItemProperty "Registry::$_\Control Panel\Desktop" -Name "Win8DpiScaling" -ErrorAction SilentlyContinue}).PSPath
    foreach ($_ in $perfis) {Set-ItemProperty -Path "Registry::$_" -Name "Win8DpiScaling" -Value 0}
    
    $monitores = (Get-ChildItem Registry::HKEY_USERS\ | Where-Object {$_.Name -match "S-1"} | ForEach-Object {Get-ChildItem "Registry::$_\Control Panel\Desktop\PerMonitorSettings" -ErrorAction SilentlyContinue}).PSPath
    foreach ($_ in $monitores) {Set-ItemProperty -Path "Registry::$_" -Name "DpiValue" -Value 0}
    

提交回复
热议问题