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


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

I found a way in powershell.

"Background {0}x{1}" -f [System.Windows.Forms.SystemInformation]::PrimaryMonitorSize.Width,[System.Windows.Forms.SystemInformation]::PrimaryMonitorSize.Height
  • This line may require issuing Add-Type -AssemblyName System.Windows.Forms before you can use it – Mikhail Jul 11 '18 at 7:49

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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