How can I launch more than one application on a Microsoft Terminal Server using a published application?
On the terminal server, create a file in a directory like c:\launchers call it launcher1.vbs
Dim objShell
Dim objExec
Dim strAppExe
Const MAXIMIZE_WINDOW=3
Const MINIMIZE_WINDOW=7
’ List of codes http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_pkoy.mspx?mfr=true
Set objShell = Wscript.CreateObject("WScript.Shell")
’ Run the first app and minimize it.
objShell.Run "notepad.exe", MINIMIZE_WINDOW
’ Run the second app
objShell.Run "mspaint.exe", MINIMIZE_WINDOW
’ Run the last app in the sequence
strAppExe = "calc.exe"
Set objExec = objShell.Exec(strAppExe)
’ Watch for this LAST app to close and logoff
Do While objExec.Status = 0
WScript.Sleep 500
Loop
Set objExec = objShell.Exec("logoff")
Next for the webapp, launch wscript and pass the parameter c:\launchers\launcher1.vbs
This will launch notepad.exe minimized, mspaint.exe minimized and calc.exe normally. It will wait for calc.exe to close before performing a logoff.