I've been experimenting with the following code (which doesn't work) and now I have got so close to it, "I can't see the wood for all the trees in the way!"

The client has designed two JPG files for each style of screen resolution within the organisation and wants me to push the wallpaper out to all workstations. He will periodically change the content of the wallpaper so it acts like a business phone directory on each user's desktop.

I have the UDF GetScreenRes() pasted at the end of the code and the variable $ScreenRes is populating correctly.


 Code:
;*********************** COPY WALLPAPER *****************************

IF @TSSESSION <> 1
  $ScreenRes = GetScreenRes()
  SELECT
    CASE $ScreenRes = "1280,1024"
      $Wallpaper = "Desktop1280x1024.jpg"
    CASE $ScreenRes = "1440,900"
      $Wallpaper = "Desktop1440x900.jpg"
    CASE 1
      $Wallpaper = "Desktop1280x1024.jpg"
  ENDSELECT    

  IF EXIST($WinDir + "\" + $WallPaper) = 0
    COPY @LSERVER + "\Netlogon\Wall\" + $WallPaper $WinDir + "\WallPaper.jpg"
  ENDIF

  $WallpaperStyle = "2"
  $TileWallpaper = "0"
  $WallpaperMode = "1"

  $=WriteValue('HKCU\Control Panel\Desktop','Wallpaper',$Wallpaper,'REG_SZ')
  $=WriteValue('HKCU\Control Panel\Desktop','WallpaperStyle',$WallpaperStyle,'REG_SZ')
  $=WriteValue('HKCU\Control Panel\Desktop','TileWallpaper',$TileWallpaper,'REG_SZ')
  $=SetWallpaper("Wallpaper.jpg", $WallpaperMode)
ENDIF

;*********************** COPY BGINFO *********************************

IF EXIST($WinDir + "\Bginfo.exe") = 0
  COPY @LSERVER + "\Netlogon\Bginfo.exe" $WinDir + "\Bginfo.exe"
ENDIF

SHELL $WinDir + "\BGInfo \\$HomeServer\NETLOGON\Wall\SUMMIT.bgi /TIMER:0"

;********************************************************************


Can someone point me in the right direction...