Scripting Provider::ExecuteScript


Executes a script that does not require rollback. Used by Microsoft. Provisioning Framework (MPF).

An example of a script that is appropriate for this procedure would be a parser program. The script can take the form of a file or an inline script block (like the <script> tag of an HTML file).

This procedure creates an intrinsic object that is available to the script, ProviderXML. ProviderXML exposes the IXMLDOMNode interface passed to the provider by a provisioning engine. The XML contains the executeData node, which contains all data passed to the provider. The script uses this object to get and return data.

XML Input Schema

The following code fragment shows the format for sending data to this procedure. For inline scripts, embed the script block in the executeData node. For more information on individual elements and attributes, see the Elements and Attributes table.

<executeData>1..1
  <providerScript language=".." file="..">1..1</providerScript>
</executeData>

XML Output Schema

ExecuteScript does not return data. However, the called script may add output elements.

Note  The called script should not store rollback data; ExecuteScript does not use it.

Elements and Attributes

The following table describes the XML elements and attributes. Unless otherwise indicated, the data type is string.

Element Description, relationships, and attributes
executeData Description:
Encapsulates the procedure's input data.

Child:
providerScript (minOccurs="1" maxOccurs="1")

providerScript Description:
Encapsulates the script to be executed. The script can take the form of a file name (with path) or an inline script block that resembles the <script> section of an HTML file.

File example:

<providerScript language='JavaScript' file="1">c:\test.js</providerScript>

Inline script example:

<providerScript language='VBScript'>
		<![CDATA[
				REM Return "<hello>World".
				set ed = ProviderXML.selectSingleNode( "executeData" )
				set newElement = ed.ownerDocument.createElement( "hello" )
				newElement.text = "World"
				sf.appendChild( newElement )
		]]>
</providerScript>

For inline scripts, it is important to avoid conflicts with XML. If the script contains characters such as "<" and ">", embed the script in a CDATA node.

Parent:
executeData

Attribute:

file Optional. Boolean that indicates whether the body of this node is a file ("1"). If this attribute is set to any other value or not specified, the script is assumed to be inline.
language Required. ProgId of the script engine to load and use to run the specified script. The script engine must be a COM object that has the OLEScript registry key and implements the script engine interfaces.

Remarks

Scripts that receive data from the executeData node of the provisioning request must use the ProviderXML object to get that data.

See Also

ExecuteScriptWithRollback, Scripting Provider


Up Top of Page
) 1999-2002 Microsoft Corporation. All rights reserved.