Adds support for command line batch files in Visual Studio 2015's
Task Runner Explorer. Supports .cmd
, .bat
, .ps1
and .psm1
files.
Download the extension at the VS Gallery or get the nightly build
The easiest way to add a batch file to Task Runner Explorer is to right-click it in Solution Explorer and select Add to Task Runner
You can right-click supported batch files in either solution folders or from within a any project.
Doing so will create a commands.json
file. If you right-clicked
a batch file in a solution folder, then the commands.json
file will be placed in the solution folder. If the batch file
is in a project you will be prompted to select to either
put it in the project or solution folder.
If a commands.json
file already exist, the new batch
file will be added.
When scripts are specified, the Task Runner Explorer will show those scripts.
Each script can be executed by double-clicking the task.
The Task Runner Explorer supports multiple task runners in the same solution. For instance, you can have commands specified for the solution and additional ones for each project in that solution.
Task Runner Explorer will try to find a commands.json
file
in any parent folder to either the individual projects or
the solution until it hits the root of the drive.
Inside commands.json it is possible to add custom scripts inside the "scripts" element.
{
"commands": {
"Build": {
"FileName": "cmd.exe",
"WorkingDirectory": ".",
"Arguments": "/c build\\build.cmd"
}
}
}
You can execute any command inside commands.json
by manually
editing it. A batch file is not needed if you just need to
execute simple commands.
You can drag any supported batch file onto commands.json
to add it. Just keep in mind that Visual Studio doesn't support
drag and drop from solution folders.
Script bindings make it possible to associate individual scripts with Visual Studio events such as "After build" etc.
If you manually edit bindings in `command.json``, then full Intellisense is provided.
For the optimal experience with batch file and Visual Studio, try the free Open Command Line extension for even more features.