How can I add a custom command to Visual Studio?

21,175

Solution 1

First, add an item to your Tools menu by choosing Tools, External Tools, and filling out the dialog, like this:

enter image description here

Then bring up Tools Customize, click the Keyboard button at the bottom, and find the appropriate external tool number:

bind to a key

Solution 2

All the configured external commands in VS are available to add to a Toolbar or Menu through the Tools>Customize menu as "External Command ##". You just need to know which number corresponds to the particular command you've configured. I believe it is in order of entry in the external commands list.

Similarly, you can find those names in the commands list in Options>Environment>Keyboard and assign a shortcut to your command that way.

Share:
21,175
Billy ONeal
Author by

Billy ONeal

Credit for Avatar image: http://www.assaultandroidcactus.com/ I'm a Microsoft Software Development Engineer on the Trustworthy Computing Team. I've worked at several security related places previously, including Malware Bytes and PreEmptive Solutions. On StackOverflow I mostly answer c++ related questions, though I occasionally forray into c# and a couple of others. I am the author of pevFind, a component of the ComboFix malware removal tool, and volunteer at BleepingComputer.com as a malware response instructor. My Twitter account is @MalwareMinigun.

Updated on July 09, 2022

Comments

  • Billy ONeal
    Billy ONeal almost 2 years

    There's an external command I'm using constantly - basically launching a batch file. I'd like to put a toolbar button (and possibly keyboard shortcut) for this into the IDE. Is there an easy way to do that?