How to abort a program start after a script failure

Article translations Article translations
Article ID: 930973 - View products that this article applies to.
Expand all | Collapse all

SUMMARY

This article describes how to abort a program start after a script failure.

MORE INFORMATION

Microsoft SoftGrid Client 3.2 and SoftGrid Client 4 support the following new attributes for the SCRIPT element in .osd files:
  • ABORTRESULT
  • SUCCESSRESULT
If the ABORTRESULT attribute is specified, the client checks the exit code of the script when the script finishes. If the exit code matches the ABORTRESULT value, the client silently aborts the program start. The ABORTRESULT attribute can be used for the following scripts:
  • Pre-stream
  • Post-stream
  • Pre-launch
  • Post-launch
For post-launch scripts, the program is silently terminated because it has already completely started. No message is displayed to the user in any of these cases.

If the SUCCESSRESULT attribute is specified, and if the ABORTRESULT value does not match the exit code of the script, the client will check the script exit code to determine whether the code matches the SUCCESSRESULT value. If the two values match, the start process continues. If the values do not match, the start fails for pre-stream scripts, for post-stream scripts, and for pre-launch scripts. Additionally, the user will see an error message. For post-launch scripts, if the script returns something other than the SUCCESSRESULT value, the program will be immediately terminated. Additionally, the user will see the standard shut-down message in the notification area.

Requirements
  • The ABORTRESULT attribute and the SUCCESSRESULT attribute are optional.
  • The attribute values must be 32-bit numbers.
  • If a TIMEOUT value is not specified, the WAIT value must be TRUE.
  • If a TMIEOUT value is specified, the WAIT value can be either TRUE or FALSE.
  • The value of SHUTDOWN for the EVENT attribute is not supported.
Configuring the .osd file
  1. Open the .osd file by using a text editor.
  2. Type the values for the SUCCESSRESULT attribute and for the ABORTRESULT attribute in the SCRIPT element.
  3. Type the desired exit codes between the quotation marks for each attribute. Refer to the following example text.
    <DEPENDENCY>
      <SCRIPT TIMING="PRE" EVENT="LAUNCH" PROTECT="TRUE" WAIT="TRUE"
        TIMEOUT="10" SUCCESSRESULT="1" ABORTRESULT="0">
        <SCRIPTBODY>IF %OS% == Windows_NT (exit 1) ELSE exit 0</SCRIPTBODY>
      </SCRIPT>
    </DEPENDENCY>
    
  4. Save and then exit the .osd file.
Behavior conditions

The program will start if the following conditions are true:
  • The exit code equals the SUCCESSRESULT value, or the SUCCESSRESULT value is null.
  • The exit code does not equal ABORTRESULT value.
Collapse this tableExpand this table
Exit CodeSUCCESSRESULTABORTRESULTClient Action
110Program starts
11NullProgram starts
1Null0Program starts
The program will silently exit if the following conditions are true:
  • An ABORTRESULT value is specified.
  • The exit code equals the ABORTRESULT value regardless of whether a SUCCESSRESULT value is specified.
Collapse this tableExpand this table
Exit CodeSUCCESSRESULTABORTRESULTClient Action
010Program silently exits
000Program silently exits
0Null0Program silently exits
The program will not start if the following conditions are true:
  • A SUCCESSRESULT value is specified.
  • The exit code does not equal the SUCCESSRESULT value or the ABORTRESULT value regardless of whether an ABORTRESULT value is specified.
Additionally, you receive an error message that contains the following error code:
xxxxxx-xxxxxx18-0000000n
Notes
  • In this code, n represents the actual exit code.
  • This error code is also written to the SoftGrid Client log file (Sftlog.txt).
Collapse this tableExpand this table
Exit CodeSUCCESSRESULTABORTRESULTClient Action
01118-00000000
21Null18-00000002
For more information about this error code, click the following article number to view the article in the Microsoft Knowledge Base:
930694 Error message when you try to start a SoftGrid program: "The SoftGrid Client could not launch <program>. Error code: <xxxxxx-xxxxxx>18-0000000<n>

Properties

Article ID: 930973 - Last Review: July 11, 2007 - Revision: 3.0
APPLIES TO
  • Microsoft SoftGrid for Terminal Services
  • Microsoft SoftGrid for Windows Desktops
Keywords: 
kbhowto kbexpertiseinter KB930973

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com