Microsoft KB Archive/930973

= How to abort a program start after a script failure =

Article ID: 930973

Article Last Modified on 7/11/2007

-

APPLIES TO


 * Microsoft SoftGrid for Terminal Services
 * Microsoft SoftGrid for Windows Desktops

-



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  Open the .osd file by using a text editor. Type the values for the SUCCESSRESULT attribute and for the ABORTRESULT attribute in the SCRIPT element.  Type the desired exit codes between the quotation marks for each attribute. Refer to the following example text.   IF %OS% == Windows_NT (exit 1) ELSE exit 0    Save and then exit the .osd file.</li></ol>

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.

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.

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:

18-0000000

Notes
 * In this code,  represents the actual exit code.
 * This error code is also written to the SoftGrid Client log file (Sftlog.txt).

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: &quot;The SoftGrid Client could not launch. Error code: <xxxxxx-xxxxxx>18-0000000<n>

Keywords: kbhowto kbexpertiseinter KB930973

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.