Const UMTBAR_EXE = """D:\Program Files\UltraMon\UltraMonTaskbar.exe"""

'stop the Smart Taskbar
Set shell = CreateObject("WScript.Shell")
shell.Run UMTBAR_EXE & " /stop", 1, True

'change the registry value storing the taskbar mode
val = shell.RegRead("HKEY_CURRENT_USER\Software\Realtime Soft\UltraMon\Smart Taskbar\Mode")
If val = 0 Then
	'mode is standard, change to mirror
	val = 1
Else
	'mode is mirror, change to standard
	val = 0
End If
shell.RegWrite "HKEY_CURRENT_USER\Software\Realtime Soft\UltraMon\Smart Taskbar\Mode", val, "REG_DWORD"

'wait until the Smart Taskbar process has terminated (up to 20 seconds)
Set wnd = CreateObject("UltraMon.Window")
For i = 1 To 20
	If wnd.Find("UltraMon Taskbar", "", 1, 0, 0) = False Then Exit For
	WScript.Sleep 1000
Next

'start the Smart Taskbar
shell.Run UMTBAR_EXE, 1, False
