Overriding High DPI Scaling from the Command Line

22,242

You make a bat file script.

Here's how.

Make sure where the application is placed.

If the application is 64 bit "%programfiles%\<appfoldername>\<app>.exe"

If the application is 32 bit "%programfiles(x86)%\<appfoldername>\<app>.exe"

~HIGHDPIAWARE Indicates value of Override high DPI scaling behavior (Application)

~DPIUNAWARE Indicates value of Override high DPI scaling behavior (System)

"~GDIDPISCALING DPIUNAWARE" Indicates value of Override high DPI scaling behavior (System Enhanced) add double quote also

I am doing this for Itunes (64 bit).

Particular User

REG ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "%programfiles%\iTunes\iTunes.exe" /T REG_SZ /D ~HIGHDPIAWARE /F

All User

REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "%programfiles%\iTunes\iTunes.exe" /T REG_SZ /D ~HIGHDPIAWARE /F
Share:
22,242

Related videos on Youtube

Adi Shavit
Author by

Adi Shavit

Updated on September 18, 2022

Comments

  • Adi Shavit
    Adi Shavit over 1 year

    I am compiling and building an OpenCV app on Windows 10, which shows some images.
    I want to overrride the high DPI scaling behavior and set it to "Application".

    I can do this fine on the .exe file by: Right-Click->Properties->Compatibility Tab and checking the checkbox.:

    enter image description here

    Is there a command line tool I can use to do that as part of a script?

  • Adi Shavit
    Adi Shavit almost 7 years
    So the Win10 prop-dlg actually generates a registry entry too?
  • Techie Gossip
    Techie Gossip almost 7 years
    yes. i have tested in windows 10 it worked. its registry to be changed
  • Adi Shavit
    Adi Shavit almost 7 years
    Thanks! Will check. Based on your answer I found this from MS which essentially says the same thing :-).
  • Javier Vélez
    Javier Vélez almost 5 years
    On Windows 10, I needed a space between the tilde and the dpi scaling value -- "~ DPIUNAWARE"
  • rjt
    rjt almost 5 years
    From @AdiShavit MS link and my own experimentation, "Note that there is a space between the tilde and the HIGHDPIAWARE."
  • Rico Picone
    Rico Picone about 2 years
    Be sure to change both HKCU and HKLM. Also use quotes around any of these options (e.g. "~ DPIUNAWARE"). Finally, be sure to have the space in there between ~ and DPIUNAWARE, or whichever mode you're going for.