Freigeben über


Using External Tools

Menu:  Tools -> External Tools; Tools -> [external tool of choice]
Command:  Tools.ExternalTools
Versions:  2008,2010
Published:  7/24/2010
Code:  vstipTool0059

 

You can run external tools by going to the Tools menu and running your external tool of choice:

image

 

If you want to add additional external tools you can go to Tools -> External Tools:

image

 

 

 

As an example, let's add the Visual Studio Command Prompt to our external tools list.  First, click the "Add" button and put in a Title of "Visual Studio Command Prompt":

image

 

In this case, the Visual Studio Command Prompt has an icon that I can use to get the information I need.  I'll just go to its properties:

image

 

To get this:

image

 

 

As you can see, the "Target" area points to %comspec% with some arguments after it.  The variable %comspec% points to the command prompt on the current Windows system and can be used on just about any version of windows.  I'll put that in as the "Command" for our uses:

image

 

If you weren't using a system variable like this you could type in the path to the command or use the ellipsis and browse:

image

 

 

 

For the "Arguments" I will, again, just take from the VS command prompt properties and put into our dialog:

image

 

If you want to add items specific to visual studio you can click the arrow to the right and get a large list of variables you can insert as arguments:

image

 

 

 

The "Initial Directory" lets you define where you want to start up in.  I don't have a preference here so I will leave it blank but I could type on a path or use one of the variables available to me by clicking on the arrow to the right:

image

 

 

 

Finally, there are several options you can choose from at the bottom:

image

 

Use Output window-runs the command and puts any output into the Output window.  This is useful for commands that just return some data you want to look at.  For our command prompt this wouldn't be a good choice since I want to type in commands.

 

Treat output as Unicode-if your tool returns Unicode output then you would check this box.

 

Prompt for arguments-shows a dialog box so you can modify the arguments before the command is run or put in completely new arguements.

image

 

Close on exit-determines if the window should close when the tool closes.  In the case of our command prompt, with this option checked, when I type "exit" and press ENTER the window closes.  However, if this options is NOT checked and I do the same thing here is what I get:

image 

 

 

 

When you are all done, just click "OK" and you will now have your command showing up in the external tools list off the Tools menu:

image

Comments

  • Anonymous
    July 24, 2010
    thanks for the tips..it works on me

  • Anonymous
    October 26, 2010
    Great comment - once I create one of these, is that information stored in a file somewhere? In other words - if I want to deploy one tool to 20 developers, do I have to tell each one of them to do the above steps? Or can I do those steps on one instance of Visual Studios, and then grab some sort of shortcut file and send it to the other 19 developers? Thanks!