Const HOTKEY = "" 'hotkey used to change desktops, see http://msdn.microsoft.com/library/en-us/script56/html/wsmthsendkeys.asp?frame=true for details
Const SHOW_DELAY = 1000 'delay before showing UltraMon taskbars after switching desktops, in milliseconds (1000 milliseconds = 1 second)

If HOTKEY = "" Then
	msg = "You'll need to set HOTKEY on the first line of the script to the hotkey you use to switch desktops before you can use the script." & vbNewline & vbNewline & "Sample hotkeys:" & vbNewline & vbNewline & "CTRL + ALT + D:   ^%(d)" & vbNewline & "F1:   {F1}" & vbNewline & "CTRL + F1:   ^({F1})" & vbNewline & "CTRL + ALT + F1:   ^%({F1})" & vbNewline & vbNewline & "To use CTRL + ALT + D as your hotkey, you would need to configure HOTKEY like this:" & vbNewline & vbNewline & "HOTKEY = ""^%(d)"""
	MsgBox msg,, "ChangeDesktop"
	WScript.Quit
End If

Set sys = CreateObject("UltraMon.System")
Set appBars = sys.DockedAppBars

'send the hotkey used to change desktops
Set shell = CreateObject("WScript.Shell")
shell.SendKeys HOTKEY

'wait to give the virtual desktop manager enough time to change desktops
WScript.Sleep SHOW_DELAY

'show the hidden UltraMon taskbar(s)
For Each ab In appBars
	If ab.Name = "UltraMon Taskbar" Then
		If ab.Visible = False Then
			ab.Visible = True
		End If
	End If
Next