Const PRIMARY_MONITOR = 1 'number of the primary monitor
Const SECONDARY_MONITOR = 2 'number of the secondary monitor

Set sys = CreateObject("UltraMon.System")
If sys.NumActiveMonitors = 1 Then
	Set mon = sys.Monitors(SECONDARY_MONITOR - 1)
	mon.Enabled = True
	mon.Primary = True
	sys.ApplyMonitorChanges
ElseIf sys.NumActiveMonitors = 2 Then
	Set mon = sys.Monitors(PRIMARY_MONITOR - 1)
	mon.Primary = True
	Set mon = sys.Monitors(SECONDARY_MONITOR - 1)
	mon.Enabled = False
	sys.ApplyMonitorChanges
Else
	MsgBox "This script is only intended for systems with two monitors.",, WScript.ScriptName
End If