Did you know… you can have your External Tool’s text displayed in the Output Window? - #204

At the bottom of the External Tools dialog, you’ll see more options for customizing the external tool within visual studio.  Today’s tip is about the Use output window option.  The idea here is you’re running a .bat file, and you want to track the progress within Visual Studio.  (and if you have a great real-world example, please leave a comment.)

Using the command prompt as the tool, you can set the Arguments to something like “/C echo $(CurText)” where

/C – from cmd.exe, carries out the command specified by string and then terminates

and

$(CurText) is a token that comes from Visual Studio that represents the currently-selected text.

Current Text Token

Now running this external tool with a line of text selected in the editor, we get the following in the output window:

Command Prompt Output in Output Window

Technorati Tags: VS2005Tip,VS2008Tip

Comments

  • Anonymous
    April 29, 2008
    Real-world example: I've got the TFPT command BranchHistory set as an external tool, and the resulting history appears in the output window.

  • Anonymous
    April 29, 2008
    Thanks Saara for a great series of blogs. I read every one of them. Keep the great work going! /Johan Stockholm, Sweden

  • Anonymous
    June 19, 2008
    How do you extend the External Tools to display more than 3 items on the Tools menu?  OOB it only shows 3, and if you add more than three external tools they don't seem to show up on the menu.  How do you resolve this?