Const UMDESKTOP_EXE = "%ProgramFiles%\UltraMon\UltraMonDesktop.exe"
Const DELAY = 0 'number of seconds to wait before reloading the wallpaper

Set sh = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

If DELAY > 0 Then WScript.Sleep DELAY * 1000

umVer = sh.RegRead("HKLM\Software\Realtime Soft\UltraMon\CurrentVersion")
curWp = sh.RegRead("HKCU\Software\Realtime Soft\UltraMon\" & umVer & "\Wallpaper\CurrentWallpaper")
wpDir = sh.ExpandEnvironmentStrings("%APPDATA%\Realtime Soft\UltraMon\" & umVer & "\Wallpapers")
wpBitmap = sh.ExpandEnvironmentStrings("%LOCALAPPDATA%\Realtime Soft\UltraMon\UltraMon Wallpaper.bmp")
curWpFile = wpDir & "\" & curWp & ".wallpaper"

On Error Resume Next 'if the file doesn't exist, DeleteFile throws an exception
fso.DeleteFile wpBitmap
On Error GoTo 0
sh.Run """" & UMDESKTOP_EXE & """ /load " & curWpFile
