Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

http://puu.sh/93YLV.jpg

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 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 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 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 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 at 19:02

1 Answer 1

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.

It 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 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 at 17:59
1  
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 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 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 at 11:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.