1

I have been trying to run

wmic path Win32_VideoController get VideoModeDescription

it gives me 1920 x 1080 which is good. I change the resolution to test it and it still returns the same thing.

Does anybody know why?

I have the first screen set to 1360 x 768

The second screen is set to 1600 x 900

enter image description here

user867621
  • 181
  • 1
  • 2
  • 9

2 Answers2

4

As stated at https://stackoverflow.com/questions/7967699/get-screen-resolution-using-wmi-powershell-in-windows-7

PS> Add-Type -AssemblyName System.Windows.Forms
PS> [System.Windows.Forms.Screen]::AllScreens


BitsPerPixel : 32
Bounds       : {X=0,Y=0,Width=1280,Height=800}
DeviceName   : \\.\DISPLAY1
Primary      : True
WorkingArea  : {X=0,Y=0,Width=1280,Height=770}

BitsPerPixel : 32
Bounds       : {X=1280,Y=0,Width=1920,Height=1200}
DeviceName   : \\.\DISPLAY2
Primary      : False
WorkingArea  : {X=1280,Y=0,Width=1920,Height=1170}
  • See edit. It doesn't work when you change the resolution – user867621 Jan 10 '17 at 17:37
  • Is that still the case if you close and reopen PowerShell? – Bill_Stewart Jan 10 '17 at 20:11
  • Note, that the returned value may be incorrect if the Windows display scaling is not 100%. To make it more robust the returned values must be multiplied by the scale factor. There are examples on the net how to get the scale factor from PowerShell. – Zoltán Tamási Sep 12 '19 at 07:37
3

I found a way in powershell.

"Background {0}x{1}" -f [System.Windows.Forms.SystemInformation]::PrimaryMonitorSize.Width,[System.Windows.Forms.SystemInformation]::PrimaryMonitorSize.Height
user867621
  • 181
  • 1
  • 2
  • 9
  • 1
    This line may require issuing Add-Type -AssemblyName System.Windows.Forms before you can use it – Mikhail Jul 11 '18 at 07:49
  • Note, that the returned value may be incorrect if the Windows display scaling is not 100%. To make it more robust the returned values must be multiplied by the scale factor. There are examples on the net how to get the scale factor from PowerShell. – Zoltán Tamási Sep 12 '19 at 07:36