Const PROFILE = "Dell + TV" 'name of the display profile
Const ICON_POS_FILE = "C:\Temp\Icons.reg" 'can optionally be set to a .reg file with saved icon positions, otherwise the last saved icon positions will be used. to create the .reg file, export the registry key HKEY_CURRENT_USER\Software\Realtime Soft\UltraMon Components\Saved Positions\Icons
Const DELAY = 1 'number of seconds to wait between applying the profile and restoring icon positions
Const INSTALL_DIR = "%ProgramFiles%\UltraMon" 'UltraMon installation folder

Set sh = CreateObject("WScript.Shell")
Set sys = CreateObject("UltraMon.System")

'check if UltraMon 3 or later is installed
Set sh = CreateObject("WScript.Shell")
umVer = sh.RegRead("HKLM\Software\Realtime Soft\UltraMon\CurrentVersion")

'get the location of the display profile folder
dirProfiles = ""
If umVer = "" Then
	'UltraMon 2
	MsgBox "This script requires UltraMon version 3.",,  WScript.ScriptName
	WScript.Quit
Else
	'UltraMon 3 or later
	dirProfiles = sh.ExpandEnvironmentStrings("%APPDATA%\Realtime Soft\UltraMon\" & umVer & "\Profiles")
End If

sh.Run """" & INSTALL_DIR & "\UltraMonShortcuts.exe"" /l """ & dirProfiles & "\" & PROFILE & ".umprofile""",, True
If ICON_POS_FILE <> "" Then sh.Run """%WINDIR%\regedit.exe"" /s """ & ICON_POS_FILE & """"
WScript.Sleep DELAY * 1000
sys.RestorePositions 2 'POS_ICONS
