Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Batch File in VS2008

Is it possible to run a batch file as a menu item in studio 2008?

like image 428
Chane Avatar asked Dec 05 '08 21:12

Chane


2 Answers

Yes, go to Tools | External Tools in the menus and add your batch file as the Command. You can also pass in any arguments that you want such as the build target, project directories, etc.

Once you do this, your batch file will appear as one of the items on your tools menu. If you want, you can then add a toolbar button for it by going Tools | Customize | Tools and dragging the External Command # that matches your tool to the toolbar. You will then want to change it to an icon and select an image for it.

The tools are numbered 1 based in the order they appear in the menu.

like image 147
Rob Prouse Avatar answered Sep 28 '22 10:09

Rob Prouse


Run batch files in VS Solution Explorer directly

This is much better than having external tool since you can execute a batch file simply by double clicking on it in solution explorer just as if you were opening a code file. I've written a blog post about it that will help you lots to configure it and of course use it.

A sidenote

You've asked this question 2 years ago, but I see that nobody mentioned this technique so I'm providing this answer for any future reference. I hope it gets upvoted, so it will be near the top for readers to see.

like image 28
Robert Koritnik Avatar answered Sep 28 '22 09:09

Robert Koritnik