Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Visual Studio toolbar commands to execute batch files

I have a few batch files I need to run frequently in developing a certain project. I'd like to create a Visual Studio toolbar called "MyProject" and have commands underneath to execute these batch files. What is the easiest way to accomplish this?

like image 772
JC. Avatar asked Oct 17 '08 18:10

JC.


Video Answer


2 Answers

In the Tools... menu, select External Tools... and add references to the batch files. Then right-click on a toolbar, select Customize..., go to the Toolbars tab, click on New..., name your new toolbar, click on OK, go to the Commands tab, select the Tools category and drag-drop the appropriate External Command Command onto your custom tool bar.

If you need to run batch files that always run right before or after a build, you're probably better off making use of build events.

like image 125
Mark Cidade Avatar answered Nov 16 '22 03:11

Mark Cidade


  1. How to install an icon in Visual Studio to run a batch file.
  2. On the menu go to Tools > External Tools
  3. Click Add and fill in the following:
    1. Title: The name that shows up for the icon name.
    2. Command: Browse to the file name and click ok or put the file path and file name here.
    3. Check Use Output window if you want to see the batch files output in visual Studio.
    4. Click OK.
  4. Make note of the position # of the Menu contents you just added starting from position 1 at top. You will use this as External Command # later on.
  5. Go to Tools > Customize or right click in the toolbar area and click Customize.
  6. Go to the Toolbars tab click New, Name the Toolbar name and click Ok.
  7. Go to the Commands tab, select the Toolbar radio button, in the dropdown to the right select your toolbar name.
  8. Click the Add Command Button. In the Categories select Tools and in the Commands to the right pick External Command # from above and click ok. It will appear in the tool bar now ready to go.
like image 37
Marc Mustric Avatar answered Nov 16 '22 01:11

Marc Mustric