Visual Studio: Launch an external tool
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| Visual Studio |
| edit |
An external tool can be launched from the Visual Studio Tool menu. A few external tools are pre-installed in Visual Studio, e.g. Create GUID. But, you can add external tools of your own choice.
Contents |
External Tools dialog box
To access the External Tools
dialog box, navigate the Tools / External Tools
menus.

Figure: Visual Studio External Tools Dialog Box
From this dialog, you can add or delete external tools. And, you can edit the Arguments and Initial directory for a tool. Also, you can reorder the list of tool names which is in the order it will appear in the Tool menu.
To add your external tool, click the Add button of the External Tools dialog box. Change the Title text box to the tool name you want to appear in the Tool menu. Enter the path to the tool in the Command text box. Or, use the arrow button next to it to browse to the tool. Finally, enter the Initial directory path; or, select one of the choices using the arrow button.
Arguments for external tools
You can choose to pass these predefined arguments to your external tool. To access them, click the arrow button to the right of the Arguments text box.
| Name | Argument | Description |
| Item Path | $(ItemPath)
| The complete file name of the current source (defined as drive + path + file name); blank if a non-source window is active. |
| Item Directory | $(ItemDir)
| The directory of the current source (defined as drive + path); blank if a non-source window is active. |
| Item File Name | $(ItemFilename)
| The file name of the current source (defined as file name); blank if a non-source window is active. |
| Item Extension | $(ItemExt)
| The file name extension of the current source. |
| Current Line | $(CurLine)
| The current line position of the cursor in the editor. |
| Current Column | $(CurCol)
| The current column position of the cursor in the editor. |
| Current Text | $(CurText)
| The selected text. |
| Target Path | $(TargetPath)
| The complete file name of the item to be built, (defined as drive + path + file name). |
| Target Directory | $(TargetDir)
| The directory of the item to be built. |
| Target Name | $(TargetName)
| The file name of the item to be built. |
| Target Extension | $(TargetExt)
| The file name extension of the item to be built. |
| Project Directory | $(ProjDir)
| The directory of the current project (defined as drive + path). |
| Project file name | $(ProjFileName)
| The file name of the current project (defined as drive + path + file name). |
| Solution Directory | $(SolutionDir)
| The directory of the current solution (defined as drive + path). |
| Solution file name | $(SolutionFileName)
| The file name of the current solution (defined as drive + path + file name). |
Close on exit check box
If the Close on exit check box is checked, the command prompt window will close when the external tool exits. Normally, this is checked. However, if you need to see the output in the command prompt window but it closes too fast to read, uncheck this.
Prompt for arguments check box
If the Prompt for arguments check box is checked, the Arguments dialog box will appear to specify new arguments or to edit existing arguments for the external tool. This will occur each time the tool is executed.
| Arguments | Lists the currently specified variables for the tool in the External Tools dialog box. For a full list of the predefined arguments, refer to Arguments for External Tools. A custom argument can also be entered.
|
| Command line | Displays the value for the arguments specified in the Arguments box.
|
Treat output as Unicode check box
If you use an external tool that generates Unicode output, you may opt to display the Unicode output in the Output window by checking this box.
Use Output window check box
If the Use Output window check box is checked, output generated by the command to the external tool will appear in the Visual Studio Output window rather than in a command prompt window. Valid only for for .bat and .com files.