Const EXE = "%ProgramFiles%\IrfanView\i_view32.exe" 'application to launch, in this case IrfanView
FILES = Array("K:\Temp\test1.jpg", "K:\Temp\test2.jpg") 'files which should get opened
MONITORS = Array(1, 6) 'number of the monitor each file should be put on
FULLSCREEN = True 'True if fullscreen mode should be used, False otherwise
TERMINATE_EXISTING_INSTANCES = True 'True if existing instances of the application should get closed at startup, False otherwise

Set sh = CreateObject("WScript.Shell")
Set sys = CreateObject("UltraMon.System")

If TERMINATE_EXISTING_INSTANCES = True Then
	Set wnd = CreateObject("UltraMon.Window")
	exeExp = sh.ExpandEnvironmentStrings(EXE)

	For Each w In wnd.GetAppWindows(False)
		If StrComp(w.ProcessExe, exeExp, 1) = 0 Then
			w.Close
		End If
	Next
End If

For i = 0 To UBound(FILES)
	Set mon = sys.Monitors(MONITORS(i) - 1)
	cmd = """" & EXE & """ """ & FILES(i) & """ /pos=(" & mon.Left & "," & mon.Top & ")"
	If FULLSCREEN = True Then cmd = cmd & " /fs"
	sh.Run cmd
Next
