Command Line Provider::ExecuteCommand


Executes the specified command line action, as well as rollback after a failure. This procedure is used to execute command line utilities in data centers that use Microsoft® Provisioning Framework (MPF).

The procedure executes a command by spawning a new process with the specified current directory and environment variables and executing the command with the given arguments. The provider waits until the timeout value for the command to complete and terminates the command's process if it takes too long.

XML Input Schema

The following code fragment shows the format for sending data to this procedure. For more information on individual elements and attributes, see the Elements and Attributes table.

<executeData>1..1
  <command>1..1
	<cmdName>1..1</cmdName>
	<args>0..1
	<arg>0..unbounded</arg>
	</args>
	<environments>0..1
	<environment name=".." value="..">0..unbounded</environment>
	</environments>
	<currentDirectory>0..1</currentDirectory>
	<timeout>0..1</timeout>
  </command>
  <undoCmd>0..1
	<cmdName>1..1</cmdName>
	<args>0..1
	<arg>0..unbounded</arg>
	</args>
	<environments>0..1
	<environment name=".." value="..">0..unbounded</environment>
	</environments>
	<currentDirectory>0..1</currentDirectory>
	<timeout>0..1</timeout>
  </undoCmd>
</executeData>

XML Output Schema

The following code fragment shows the format for data this procedure returns. For more information on individual elements and attributes, see the Elements and Attributes table.

<executeData>1..1
  <command>1..1
	<output>1..1</output>
	<error>1..1</error>
	<responseCode>1..1</responseCode>
  </command>
</executeData>

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
arg Description:
Argument supplied to the command. Arguments that contain spaces must be enclosed by quotes (for example, <arg>"c:\program files\"</arg>).

Parent:
args

args Description:
Encapsulates the arguments supplied to the command.

Parent:
command, undoCmd

Child:
arg (minOccurs="0" maxOccurs="*", input)

cmdName Description:
Name and path to the command.

Parent:
command, undoCmd

command Description:
Encapsulates the arguments, current directory, and other information used to execute the command.

Parent:
executeData

Children:
args (minOccurs="0" maxOccurs="1", input)
cmdName (minOccurs="1" maxOccurs="1", input)
currentDirectory (minOccurs="0" maxOccurs="1", input)
environments (minOccurs="0" maxOccurs="1", input)
error
(minOccurs="1" maxOccurs="1", output)
output
(minOccurs="1" maxOccurs="1", output)
responseCode (minOccurs="1" maxOccurs="1", output)
timeout (minOccurs="0" maxOccurs="1", input)

currentDirectory Description:
Directory to execute the command from.

Parent:
command, undoCmd

environment Description:
Environment variable used by the command.

Parent:
environments

Attributes:

name Required. Name of the environment variable.
value Required. Value of the environment variable.
environments Description:
Encapsulates environment variables used by the command.

Parent:
command, undoCmd

Child:
environment (minOccurs="0" maxOccurs="*", input)

error Description:
Results of the error stream from the command in an XML CDATA block.

Parent:
command

executeData Description:
Encapsulates the procedure's input and output data.

Children:
command (minOccurs="1" maxOccurs="1", input and output)
undoCmd (minOccurs="0" maxOccurs="1", input)

output Description:
Results of the output stream from the command in an XML CDATA block.

Parent:
command

responseCode Description:
Decimal exit code of the command.

Parent:
command

timeout Description:
Timeout interval in milliseconds. If the command does not complete within the specified time interval, the provider generates an error.

Parent:
command, undoCmd

undoCmd Description:
Encapsulates the arguments, current directory, and other information used to roll back the command.

Parent:
executeData

Children:
args (minOccurs="0" maxOccurs="1", input)
cmdName (minOccurs="1" maxOccurs="1", input)
currentDirectory (minOccurs="0" maxOccurs="1", input)
environments (minOccurs="0" maxOccurs="1", input)
timeout
(minOccurs="0" maxOccurs="1", input)

See Also

Command Line Provider


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