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

后端 未结 7 1984
别那么骄傲
别那么骄傲 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 18:04

    @Torben Schramme I found that I had to add one more ItemProperty Win8DpiScaling for this work. But, I don't find the "logoff; exit" function working - I still have to do it manually.

    cd 'HKCU:\Control Panel\Desktop'
    $val = Get-ItemProperty -Path . -Name "LogPixels"
    if($val.LogPixels -ne 96)
    {
         Write-Host 'Change to 100% / 96 dpi'
         Set-ItemProperty -Path . -Name LogPixels -Value 96
         Set-ItemProperty -Path . -Name Win8DpiScaling 0
    } else {
         Write-Host 'Change to 150% / 144 dpi'
         Set-ItemProperty -Path . -Name LogPixels -Value 144
         Set-ItemProperty -Path . -Name Win8DpiScaling 1
    }
    logoff;exit
    
    0 讨论(0)
提交回复
热议问题