This

 Code:
$wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_DesktopMonitor")
For Each $wmiObj In $wmiColl
	Select
		Case $wmiObj.DeviceID = "DesktopMonitor1"
			$screenres1 = CSTR($wmiObj.ScreenWidth) + "x" + CSTR($wmiObj.ScreenHeight)
		Case $wmiObj.DeviceID = "DesktopMonitor2"
			$screenres2 = CSTR($wmiObj.ScreenWidth) + "x" + CSTR($wmiObj.ScreenHeight)
	EndSelect
Next


works for me. It gets the resolution from the first monitor/connector and set the wallpaper depending on the outcome. If you need the second monitor (or both) you could use DesktopMonitor1 and/or DesktopMonitor2.


Edited by Mart (2008-08-04 09:57 AM)
Edit Reason: typo
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.