Share via


EXECUTEPROCESS

5/10/2007

This command allows you to execute a process.

Syntax

15, [ErrorMode], [RebootOK], [ExpandMode],[ApplicationName],
[ExpandMode], [CommandLine], [WaitForCompletion], [Timeout],
[InheritHandles], SecRev, [InheritHandles],[ExpandMode],[ProcSecAttrib],
SecRev, [InheritHandles],[ExpandMode],[ThreadSecAttrib], [CreationFlags],
[ExpandMode],[CurrentDirectory], [1, StartupInfo] | [0], [NewEnv]

Parameters

  • ErrorMode
    Optional. Specified as a decimal representation of a hexadecimal bitmask. Values must be specified in decimal format. The following table shows the possible values.

    Value Name Description

    0 (0xnnnn0000)

    DAERH_ABORT

    Default. The abort-on-error mode stops the command file from processing further.

    32768 (0xnnnn8000)

    DAERH_IGNORE

    The ignore-on-error mode continues by processing the next command when an error occurs.

    32769-33023 (0x000080xx where xx!=00 is the number of retries)

    DAERH_RETRY_WITHIGNORE

    The retry-on-error with ignore mode retries the offending command up to 255 times. If the number of retries exceeds the retry count, this mode continues processing the next command.

    1-255(0x00xx where xx!=0 is the number of retries from 1-255)

    DAERH_RETRY_WITHABORT

    The retry-on-error with abort mode retries the offending command up to 255 times. If the number of retries exceeds the retry count, the command file processing halts.

    65536 – 4294901760(0xFFFFnnnn where FFFF is the delay mask in seconds)

    DAERH_DELAYMASK

    The delay error mode value is added to either the DAERH_RETRY_WITHIGNORE or the DAERH_RETRY_WITHABORT value to cause a delay between retries. This value is in seconds and has a range between 1 and 65535.

    Note

    Parsing errors, especially the passing of not valid command parameters, generates an error in DAERH_ABORT error mode. With logging enabled, an appropriate error message is output to the log file.

  • RebootOK
    Optional. Specifies if the system can reboot. The following table shows the possible values.

    Value Name Description

    0

    DANO

    System cannot reboot.

    1

    DAYES

    System can reboot.

  • ExpandMode
    Optional. Specifies if the string that follows it is an environment variable that should be expanded. Can occur multiple times with this command. The following table shows the possible values.

    Value Description

    0

    Does not expand the string.

    1

    Device Update Agent expands the string on the embedded device.

    2

    Device Update Agent script compiler expands the string on the developer computer.

  • ApplicationName
    Optional. String that specifies the module to execute. The string can specify the full path and file name of the module to execute or it can specify a partial name. In the case of a partial name, the command uses the current drive and directory to complete the specification.
  • CommandLine
    Optional. String that represents any command-line arguments to be passed to the executable module.
  • WaitForCompletion
    Optional. The following table shows the possible values.

    Value Name Description

    0

    DANO

    The Device Update Agent does not wait for the completion of the command being executed.

    1

    DAYES

    The Device Update Agent should wait for the completion of the command being executed.

    2

    DASPECIAL

    The Device Update Agent waits until the process that was started is waiting for user input.

  • Timeout
    Optional. Specifies, in milliseconds, how long the Device Update Agent should wait for a command to complete. The timeout value is used only if WaitForCompletion is DAYES or DASPECIAL.

    The value can be 0 thru 4294967295 (default = 0), which specifies the time, in milliseconds. A value of 4294967295 causes an infinite delay.

  • InheritHandles
    Optional. Indicates whether the new process inherits handles from the calling process. Inherited handles have the same value and access privileges as the original handles. The following table shows the possible values.

    Value Name Description

    0

    DANO

    Process does not inherit handles from the calling process.

    1

    DAYES

    Each inheritable open handle in the calling process is inherited by the new process.

  • ProcSecAttrib
    Optional. A SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If ProcessAttributes is not specified, the handle cannot be inherited. For more information, see Security Revision and Security Attributes.
  • ThreadSecAttrib
    Optional. A SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If ProcessAttributes is not specified, the handle cannot be inherited. For more information, see Security Revision and Security Attributes.
  • CreationFlags
    Optional. CreationFlags define how a process is created. For more information, see Creation Flags.
  • CurrentDirectory
    Optional. Specifies the path to the new current directory. This parameter can be a relative path or a fully qualified path.
  • StartupInfo
    Optional. Specifies the window properties for a new process. For more information, see STARTUPINFO.
  • NewEnv
    Optional. If not specified, by default the process that was started inherits the environment of the parent. For more information, see Environment Block.

Remarks

RebootOK indicates to the Device Update Agent that the command being executed can cause the system to reboot. By setting RebootOK to DAYES, the Device Update Agent expects a possible reboot and continues processing commands if a reboot were to occur. If the RebootOK parameter is set to the DANO value, the agent does not expect a reboot and stops processing commands if a reboot occurs because it was executing the current command.

For more information, see the Microsoft Windows SDK documentation at this Microsoft Web site.

Example

The following example shows typical use.

//
// ExecuteProcess
//
EXECUTEPROCESS,,,,c:\windows\system32\cmd.exe,,c:\windows\system32\cmd.exe /k set,DAYES,60000,,DASEC_REV,,,,DASEC_REV,,,,,,c:\windows\system32,1,,WinSta0\Default

See Also

Concepts

DUA Script Command Reference