Use the Run Command Line task sequence step to run any command-line. This task sequence action can be run in a standard operating system or the Windows Preinstallation Environment (WinPE). For information about task sequence variables for this task sequence action, see Run Command Line Task Sequence Action Variables.

You can configure the following settings on the Properties tab.

Name

Specifies a short user-defined name that describes the command line that is run.
Description

Specifies more detailed information about the command line that is run.
Command line

Specifies the command line that is run. This field is required. File name extensions are strongly recommended—for example, .vbs and .exe. Include all required settings files, command-line options, or switches. If the file name does not have a file name extension specified, Configuration Manager 2007 tries .com, .exe, and .bat. If the file name has an extension that is not an executable, Configuration Manager 2007 tries to apply a local association. For example, if the command line is readme.gif, Configuration Manager 2007 starts the application specified on the target computer for opening .gif files.Examples:setup.exe /a cmd.exe /c copy Jan98.dat c:\sales\Jan98.dat
Note
Command-line actions, such as output redirection, piping, or copy—as in the preceding example—must be preceded by the cmd.exe /c command to run successfully.
Disable 64-bit file system redirection

By default, when running on a 64-bit operating system, the executable in the command line is located and run using the WOW64 file system redirector so that 32-bit versions of operating system executables and DLLs are found.  Selecting this option disables the use of the WOW64 file system redirector so that native 64-bit versions of operating system executables and DLLs can be found.  Selecting this option has no effect when running on a 32-bit operating system.
Start in

Specifies the executable folder for the program, up to 127 characters. This folder can be an absolute path on the target computer or a path relative to the distribution point folder that contains the package. This field is optional. Examples:c:\officexp i386
Note
The Browse button browses the local computer for files and folders, so anything you select this way must also exist on the target computer in the same location and with the same file and folder names.
Package

When you specify files or programs on the command line that are not already present on the target computer, select this option to specify the Configuration Manager 2007 package that contains the appropriate files. The package does not require a program. This option is not required if the specified files exist on the target computer.
Time-out

Specifies a value that represents how long Configuration Manager 2007 will allow the command line to run. This value can be from 10 minutes to 999 minutes. The default value is 15 minutes. This option is disabled by default.
Important
If you enter a value that does not allow enough time for the Run Command Line task sequence step to complete successfully, the task sequence step will fail and the entire task sequence could fail depending on other control settings. If the time-out expires, Configuration Manager 2007 will terminate the command-line process.
Run this step as the following account

Specifies that the command line should be run as a Windows user account other than the local system account.Applies only to Configuration Manager 2007 R2 or later.
Account

Specifies the Run As Windows user account for the command-line task in the task sequence to be run by this action. The command line will be run with the permissions of the specified account. Click Set to specify the local user or domain account.Applies only to Configuration Manager 2007 R2 or later.
Important
If a Run Command Line task sequence action specifying a user account is executed while in Windows PE, the action will fail because Windows PE cannot be joined to a domain. The failure will be recorded in the smsts.log file.

Options Tab

On the Options tab for this task sequence step, an additional option is available: Success Codes.

The success codes are user-defined values that are treated as successful result codes from the execution of the command line. This field can contain integers separated by any combination of a comma, space, or tab. This field is enabled only if the step contains a Run Command Line action.

When a task sequence step runs a command line, it returns a result code upon completion. The result code is then compared against a list of success codes to determine whether the command line and the task sequence step completed successfully.

Note
Only the first success code can be a negative number; all other success codes must be a positive number. Valid success codes example:-1 2 3 4 Nonvalid success codes examples:-1 -2 3 4 1 -2 3 4

See Also