Like MCA said screenres is a very good option. Is depends on WMI beeing installed.

For all workstations not having WMI installed we use the following to set the correct size company wallpaper. First a check which videoboard is installed because the last part of the reg key is different for most cards (even for just different driver versions) and then read the x and y reslolution.


Code:

;Read screen resolution for Nvidia Vanta cards
$resolutionx = ReadValue("HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\SERVICES\NV\DEVICE0", "DefaultSettings.XResolution")
$resolutiony = ReadValue("HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\SERVICES\NV\DEVICE0", "DefaultSettings.YResolution")
$resolution = $resolutionx + "x" + $resolutiony
;Checking if wallpaper exists
If Exist ("C:\WINNT\wallpaper" + $resolution + ".bmp") = 0
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "\wallpaper\" + "wallpaper" + $resolution + ".BMP C:\WINNT"
Else
$LOCAL = GetFileTime ("C:\WINNT\wallpaper" + $resolution + ".bmp")
$LOGON = GetFileTime (@LDRIVE + "\wallpaper\" + "wallpaper" + $resolution + ".BMP")
If ($LOCAL <> $LOGON)
Shell "%COMSPEC% /E:1024 /C COPY " + @LDRIVE + "\wallpaper\" + "wallpaper" + $resolution + ".BMP C:\WINNT"
EndIf

EndIf



This script is up for a revission soon so for example the comspec copy will be replaced with the kix copy function. Currently we are pushing WMI to all machines without WMI so Screenres() udf will be inplemented also.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.