DOS
Top  Previous  Next


Executes DOS command or other program on the local machine

Like with all other SetupBatcher commands, if an errors occurs during a DOS command the script will stop and the command output is displayed in the log window. Read about error handling here.

The DOS command is always executed on the local machine on which SetupBatcher is run. If a command must be executed on a remote machine (example: "net share" on a remote server), use DOSR.

SetupBatcher cannot detect commands that asks for input, try to set BatchSettings.Debug if things does not work as expected. When needed, use the echo command to pipe input to the command - see example 2 below.

Tip: pipe command output to a file and use the FileValue function to read it.

Category
General

Script section
All

DOS [Timeout,] Command

Timeout [Optional parameter]
Seconds, 0-60000, default 60  
 
The DOS command has a default 60 second time-out, any command that does not finish within this period will stop and return an error.  

Command
Command to execute / program to run + command line parameters. Remember to specify full path for executables unknown to the system.  
 
List of useful command line / resource kit tools  

Other parameters
This command is executed on the local machine.  

Examples
1) Create a directory on the local machine

DOS md c:\users\%col1%

2) Run CACLS on the local machine, wait 120 seconds for the command to finish (CACLS can take a long time if there are many files and folders)

DOS 120, echo y| cacls h:\userroot\steve /g steve:F System:F