When building an SCCM 2012 task sequence, a Run Command Line task can be added to execute CMDs:
When needing to run multiple commands, adding a separate Run Command Line tasks for each command will work. But sometimes combining multiple commands into a single step will be more efficient.
The & Operator
Multiple commands can be ran within one Run Command Line task by separating commands with the & (AND) operator. For example, the following command will make a directory and then copy a file to it:
md C:\Temp & copy file.txt C:\Temp\file.txt
You can also utilize && and ||
There are a couple of additional conditional execution operators that can be useful.
Using && (IF) means execute the first command and run the second if it succeeds, which might have been a better idea for the example given above.
Using || (OR) means only execute the second command if the first one fails.
All these same operators can also be used when executing commands from a regular Windows command prompt. Use these techniques to clean up and optimize task sequences that run multiple commands.