Can the Visual Studio (2010) Command Window handle "external tools" with project/solution relative p

Posted by ee on Stack Overflow See other posts from Stack Overflow or by ee
Published on 2010-05-11T14:58:46Z Indexed on 2010/05/15 4:24 UTC
Read the original article Hit count: 208

I have been playing with the Command Window in Visual Studio (View->Other Windows->Command Window). It is great for several mouse-free scenarios. (The autocompleting file "Open" command rocks in a non-trivial solution.) That success got me thinking and experimenting:

  • Possibility 1.1: You can use the Alias commands to create custom commands
  • Possibility 1.2: You can use the Shell command to run arbitrary executables and specify parameters (and pipe the result to the output or command windows)
  • Possibility 2: A previously setup external tool definition (with project-relative path variables) could be run from the command window

What I am stuck on is:

  1. There doesn't appear to be a way to send parameters to an aliased command (and thus the underlying Shell call)
  2. There doesn't appear to be a way to use project/solution relative paths ($SolutionDir/$ProjectDir) on a Shell call
  3. Using absolute paths in Shell works, but is fragile and high-maintenance (one alias for each needed use case). Typically you want the command to run against a file relative to your project/solution.
  4. It seems you can't run the traditional external tools (Tools->External Tools...) in the command window

Ultimately I want the external tool functionality in the command window in some way. Can anyone see a way to do this? Or am I barking up the wrong tree?

So my questions:

  1. Can an "external tool" of some sort (using relative project/solution path parameters) be used in the Command Window?
  2. If yes, How?
  3. If no, what might be a suitable alternative?

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about command-window