Is it possible to change the DPI settings using a batch file?

Hello All

I have a few users that like to change their DPI in monitor resolution to either 125% or 150%.  I tried using Display Changer from 12noon and so far it is terrific, but I cannot get it to change the DPI back to 100% (I can get it to reset their overall resolution to max but DPI does not change).

Is there some commands that I could put in a batch file that will detect the DPI and then reset it to 100% (and also set it back when they want to).  The owner of the company does not want the users having to reset it manually each time they want to run my program (It is in Access).

ANy advice is very much appreciated.
Andy
alevin16Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alevin16Author Commented:
Thanks Jim!
Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Andy,
What version and bit-level of Windows? Regards, Joe
alevin16Author Commented:
Hi Joe

The version of windows is 8.1 64 bit.

Andy
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Andy,

Based on your question, it sounds as if you're a programmer, so I presume you know how to read and write registry keys. This MS TechNet article explains the DPI settings. Note the section called Scaling override in Windows 8.1 scaling mode, which discusses this registry key:

HKCU\Control Panel\Desktop\DesktopDPIOverride

And the section called System-wide scale factor in Windows 8 scaling mode, which discusses this registry key:

HKCU\ControlPanel\Desktop\LogPixels

Your program can read those values and save them, then change them to whatever you want, then restore the original values before exiting. I haven't tried this in W8.1 and I don't have a W8.1 sandbox that I can experiment with right now, but I think it's worth a shot for you. Btw, note that the scaling factor must be in the 100-500% range. Regards, Joe

Update: Andy, I don't have a W8.1 sandbox, but I do have a W8 one, and I just tried it there. Here's what happened:

(1) This key does not exist (and was not created when increasing DPI):

HKCU\Control Panel\Desktop\DesktopDPIOverride

(2) This key does exist and was changed to 120 when increasing the DPI via Control Panel from 100% to 125%:

HKCU\ControlPanel\Desktop\LogPixels

(3) In addition, the value AppliedDPI (a DWORD) was changed from 96 to 120. It is located here:

HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics

I don't know if this will be the same in W8.1, but I thought the info might be helpful for you. Regards, Joe
alevin16Author Commented:
Hello Joe

This is great.  I am going to give this a shot.  I am a programmer but not an expert by any means.  I like to think I am an intermediate, I know a little so I am dangerous.

THanks!
Andy
Joe Winograd, Fellow&MVEDeveloperCommented:
You're welcome, Andy. I'm very curious to hear your results. This is a fascinating question!
Joe Winograd, Fellow&MVEDeveloperCommented:
Andy,
One other thing. The DPI change takes effect only after you log off then log back on. The good news is that a reboot is not required, but it still means that your program has to change the DPI to what it needs, log off, log back on, do its processing, change the DPI back to what it was, log off, and log back on again. Regards, Joe

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
alevin16Author Commented:
I have not been able to try it under all circumstances but it seems to be working.  I will repost with more when they let me get back to it
Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Andy,
Good news that it seems to be working. I look forward to hearing more whenever you have updates. Regards, Joe
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.