The below script will find the screen aspect ratio of a computers primary video controller by querying WMI.

The script stores the horizontal and vertical resolution for each video controller in an array and returns the result of dividing the horizontal by the vertical for the first controller. If the computer has any other controllers there resolutions will also be in the array.

You could modify this script and use it for a few different purposes, I have used this method to deploy wallpapers to computers with the correct aspect ratio.

Author: Phil Eddies

I am an IT Operations Manager, managing all aspects of the IT infrastructure and service for a mid sized UK based company. I have been working full time in IT since 2001 in 1st to 3rd line and System Administration roles. MCSA, MCSE, CCNA, Citrix CCA