This article outlines two options for publishing shortcuts in the XenApp environment.
Complete one of the following procedures to publish shortcuts in your XenApp environment:
Create the shortcut and modify its properties as necessary.
start c:\app\shortcut.lnk
Create the shortcut and modify its properties as necessary.
Note the %comspec% variable with the /c switch. This effectively opens a command window, launches the application from its shortcut within the command window, and then closes the command window. As of 6/11/2008, this extra variable was observed to be necessary on servers running Windows Server 2003 or Windows 2000 Server with varying service pack levels, although it was not required when executing the script on Windows XP.
'AppLaunch.vbsOn Error Resume NextDim sAppPathSet WshShell = WScript.CreateObject("WScript.Shell")' Path to the shortcutsAppPath = "%comspec% /c c:\app\shortcut.lnk"' Executes the program then closes the script.Return = WshShell.Run(sAppPath, 1, false)Wscript.quit
Publish this script using the absolute path to wscript.exe and the absolute path to the VBScript passed as a parameter. For example:
c:\windows\system32\wscript.exe "c:\AppLaunch.vbs"