If each project has a few batch files associated with it then why not include them in the project and add a new external tool and link it with a custom menu item to run the tool? This will give you a list of batch files in each project and a context menu command to run them. The only downside is that it isn’t file type specific (it will let you run any file as a batch file).
Here’s how to do it…
Create an external tool called “Run batch file”
- Set the Command to: CMD.EXE
- Set the Arguments to: /c “$(ItemPath)”
- Set the Initial directory to: $(ItemDir)
- Check the “use output window” checkbox and then Apply to create the command
- Note where the new command appeared in the list of commands. The external commands are numbered from 1 starting below the divider bar. #1 is usually “Create GUID”
Now go to Tools -> Customize and select the commands tab.
- Select the Context menu radio button and select “Project and Solution Context menus | Item” from the dropdown.
- Now use “Add Command…” to add a new command
- In the Categories list select “Tools”
- From the commands select the “External Command #” that corresponds to the position of the “Run Batch file” custom command you noted the number of in step 5 above.
- Move it to the correct position in the list add keyboard shortcuts etc.
- Close the dialog.
Now right click on the batch file and you should see a “Run batch file” menu item. This will execute the batch file and show its output in the VS Output window.