Examples

Example 1 - ABORTRESULT and SUCCESSRESULT

If ABORTRESULT is specified, the client will check the script's exit code when it completes. If SUCCESSRESULT is specified (and if ABORTRESULT is not or it does not match the script's exit code), the client will check the script's exit code to see if it matches the value in SUCCESSRESULT.

 <DEPENDENCY> <SCRIPT TIMING="PRE" EVENT="LAUNCH" PROTECT="TRUE" WAIT="TRUE" TIMEOUT="10" SUCCESSRESULT="1" ABORTRESULT="0"> 
 <SCRIPTBODY>@ if not %COMPUTERNAME% == "SpecialComputer" exit 1 @ exit 0 
 </SCRIPTBODY> 
 </SCRIPT> 
 </DEPENDENCY>

A more detailed explanation of these commands can be found at:

https://support.microsoft.com/kb/930973/en-us

 

Example 2 - Pre-Launching Command Prompt

 <DEPENDENCY>
 <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
 <SCRIPTBODY>cmd.exe</SCRIPTBODY>
 </SCRIPT>
 </DEPENDENCY> 

 

Example 3 - Embedding Batch File Commands within OSD File

 <DEPENDENCY>
 <SCRIPT EVENT="LAUNCH" TIMING="PRE" PROTECT="TRUE" WAIT="TRUE">
 <SCRIPTBODY>
 net use k: \\\\w2k-pdc\\netlogon\n
 CALL k:\\usr-w2k.cmd\n
 \\\\sfc-softgrid\\shr\editini.exe c:\\word\\word.ini "File Locations" TempPath c:\\temp\n
 </SCRIPTBODY>
 </SCRIPT>
 </DEPENDENCY>

 

Example 4 - Pre-Launching EXE from within the Sequence

 <DEPENDENCY>
 <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
 <SCRIPTBODY>%SFT_MNT%\\OfficeXP\\Office10\\proflwiz.exe</SCRIPTBODY>
 </SCRIPT>
 </DEPENDENCY> 

 

Example 5 - Pre-Launching a Data File (e.g. AVI file) from within the Sequence

 <DEPENDENCY>
 <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
 <SCRIPTBODY>%SFT_MNT%\\App\\Data\\Sequencing.avi</SCRIPTBODY>
 </SCRIPT>
 </DEPENDENCY> 

NOTE: In this example, the sequencing.avi launches the locally installed Media Player.

 

NOTE: A data file (e.g. sequencing.avi) cannot be specified within the FILENAME entry of the CODEBASE tag as shown below.

 <CODEBASE
 FILENAME="App\Data\Sequencing.avi"
 SYSGUARDFILE="App\osguard.cp"
 HREF="rtsp://softgrid:554/app.sft"
 GUID="A2A6D95E-8898-41C0-8020-797B23A1E917"
 SIZE="33363442"/>

 

Example 6 - Pre-Launching a Control Panel Applet within the Sequence

 <DEPENDENCY>
 <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
 <SCRIPTBODY>%SFT_MNT%\\App\\CPL\\SYSDM.CPL</SCRIPTBODY>
 </SCRIPT>
 </DEPENDENCY> 

 

Example 6a - Pre-Launching a Control Panel Applet within the Sequence

 <DEPENDENCY>
 <SCRIPT TIMING="PRE" EVENT="LAUNCH" WAIT="TRUE" PROTECT="TRUE">
 <SCRIPTBODY>
 "C:\\Program Files\\Common Files\\System\\Mapi\\1033\\mlcfg32.cpl"
 </SCRIPTBODY>
 </SCRIPT>
 </DEPENDENCY>

Feel Free to add your SCRIPTBODY examples that you may have done to the comments below. Would like to get a nice set for you all to refer to in the future!