If you need to run an executable command like Dism.exe as a step of a task sequence when you are deploying Windows using Microsoft Deployment Toolkit (MDT), you can easily do this by adding a Run Command Line step in your task sequence by clicking Add, selecting General, and selecting Run Command Line.
However, what if instead of executing a single command like Dism.exe you want to execute a batch file like foo.bat that will run a whole series of commands? In that case, instead of just making your Run Command Line step execute this:
you should make it execute this instead:
cmd.exe /c <path>\foo.bat
otherwise your batch file may not run properly.
Mitch Tulloch is an eleven-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows Server and cloud computing technologies. For more information see http://www.mtit.com.