Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to create a keyboard shortcut to quickly and easily change the DPI scale on my machine, by means of creating a small macro to run upon detection of the keyboard shortcut.

In Windows 8.1, the desktop display DPI scale can be set via the control panel (pictured below), taking effect immediately. Alternatively, the scale can be set manually in the registry, but doing so requires that the user sign in and out or restart the machine in order to take effect (and only works to imitate the "one scaling level for all my displays" option).

How can I set the DPI scale via the command line, or otherwise programmatically?

share|improve this question
Have you tried making the registry change, killing the explorer process, then starting it again. Because thats all the GUI method would do in theory. – Ramhound May 27 '14 at 22:50
@Ramhound No luck. The GUI interface is definitely doing something to refresh the desktop in order to apply the setting, but I'm not sure what and haven't been able to find anything about it. – Vulcan May 27 '14 at 23:33
Are you sure the changes take place immediately? I get a dialog saying "You must sign out of your computer to apply these changes" – Vinayak Aug 24 '14 at 18:30
@Vinayak, The changes take place immediately when applied by the above dialog. I do recall reading that the immediate-application is new to Windows 8.1 over standard Windows 8, so if you're interested it researching that difference between your machine and mine, that could be a place to start. – Vulcan Aug 24 '14 at 18:58
@Vulcan Actually, I am using Windows 8.1. However, I was trying to make changes after clicking on the Let me choose one scaling level... checkbox as the slider above it is greyed out on my notebook. – Vinayak Aug 24 '14 at 19:02

The correct registry key for monitor independent scaling is HKCU:\Control Panel\Desktop with the value LogPixels. More Information about all DPI-related registry settings can be found here: There are also information for the case when you enabled different scaling for each display.

I wrote a tiny PowerShell script that changes the DPI scaling for all displays depending on the current scaling and performs the user logoff so i just have to execute the script when I put my device to a different monitor.

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
} else {
    Write-Host 'Change to 150% / 144 dpi'
    Set-ItemProperty -Path . -Name LogPixels -Value 144


I think you can modify it for your needs with the information of the TechNet article.

share|improve this answer
My apologies for not responding sooner; great solution! Unfortunately, however, using the LogPixels value only applies when the "Let me choose one scaling level for all my displays" checkbox is checked, something I had observed when messing with the registry values myself but is also confirmed by the linked Technet article. Also, your solution has the caveat of requiring user logout; the DPIs aren't updated without the user logging out and back in again. Between these two drawbacks, your solution doesn't quite work for me, but +1 all the same for a great answer. – Vulcan Mar 31 '15 at 1:11
It does not work on Windows 10 :( – kokbira May 9 at 19:04

There is PowerShell script to change screen resolution which might help. I have no idea if the change it does is immediate on Windows 8.1, but with a bit of luck this script might use the same API as used by the Control Panel applet.

The complete Set-ScreenResolution.ps1 script is available in the Script Repository, but is too long to reproduce here.

Its description by the author can be found in the article :
Hey, Scripting Guy! How Can I Change My Desktop Monitor Resolution via Windows PowerShell?.

Some information on using it can be found in the article :
Changing Screen Resolution with Powershell.

share|improve this answer
These resources look more oriented towards changing the screen resolution rather than the DPI. I looked at the links you provided, but I only see options to set the width and height, and no mention of DPI. Am I misunderstanding your answer? – Vulcan Aug 26 '14 at 16:32
Changing the resolution will change the DPI and vice verso. You could find out the screen resolution under different DPI settings, then change to these resolutions using the above script. – harrymc Aug 26 '14 at 17:59
While changing the resolution does change the DPI, it's not quite the same thing as the DPI scaling offered in Win8 (maybe it's different on other operating systems?) An example of this is that regardless of what the DPI scaling is set to, the desktop and its icons are always the same in size and appearance, whereas if the resolution is changed, the desktop and its icons change in size accordingly. – Vulcan Aug 27 '14 at 3:01
This is because of the new DPI-aware technology introduced in Windows 8.1. I haven't been able to find any information about its API - only registry setting are currently available, which is not what you are looking for. – harrymc Aug 27 '14 at 7:02
Explorer is DPI-aware so desktop icons keep their size, but very few other programs are. For most products, changing the resolution is as good as changing the DPI. – harrymc Aug 28 '14 at 11:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .