Configuring Cmdlines.txt to Perform Tasks

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

The Cmdlines.txt file contains a list of commands, programs, scripts, or batch files that are executed at the end of GUI mode stage Setup. You can configure Cmdlines.txt to run multiple commands, programs, scripts, or batch files. The commands, programs, scripts, and batch files run synchronously; for example, a command waits for the previous command to finish running before it starts. This means that you can control the order in which commands, programs, scripts, and batch files run. By default, Cmdlines.txt is not created, so you must manually create the file and save it in the $OEM$ folder in your distribution share.

The syntax for Cmdlines.txt is as follows:

[Commands]
"command_1""command_2" 
     .
     .
"command_x"

Where command_1, command_2, and command_x refer to the commands, programs, scripts, or batch files that you want to run when GUI mode stage of Setup is complete. Note that all commands must be enclosed in quotation marks. Also, if you are using the command line (Cmd.exe) to run commands, programs, scripts, or batch files, then you need to use the /c parameter with the cmd command. For example, to create a new folder named Test on drive C, you type:

" cmd /c mkdir c:\Test"

To use Cmdlines.txt, you need to:

  • Add the following section, entry, and value to your answer file:

    [Unattended]
    OemPreinstall = Yes
    
  • Configure your Cmdlines.txt file, and save it in the $OEM$ folder in your distribution share.

  • Copy all of the programs, scripts, and batch files that are listed in your Cmdlines.txt file to the $OEM$ folder in your distribution share.

For a worksheet to assist you in recording the commands, programs, scripts, and batch files that you want to run by using Cmdlines.txt, see "Answer File Settings Worksheet" (ACIUI_5.doc) on the Windows Server 2003 Deployment Kit companion CD (or see "Answer File Settings Worksheet" on the Web at https://www.microsoft.com/reskit).