我一直在努力跑步
wmic path Win32_VideoController get VideoModeDescription
它给我1920 x 1080这是很好的。 我改变分辨率来testing它,它仍然返回相同的东西。
有人知道为什么吗?
我有第一个屏幕设置为1360 x 768
第二个屏幕设置为1600 x 900
正如在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}
我在PowerShell中find了一个方法。
"Background {0}x{1}" -f [System.Windows.Forms.SystemInformation]::PrimaryMonitorSize.Width,[System.Windows.Forms.SystemInformation]::PrimaryMonitorSize.Height