-1

I'm using a macro in Visual Studio 2010 to do some stuff with a .bat. The .bat generate some output text in the Command Line Console. Is it possible to get the output text, to display it in the output pane?

Here is a part of my code:

Sub CompileSCSS()

    Dim cmd As String

    cmd = String.Format("{0} watch {1} ", "C:\Ruby192\bin\Compass.bat", "C:\Workspace\MyProject\Solution\WebApp")
    Shell(cmd, AppWinStyle.NormalNoFocus, False)

    Write("Debug", "I want to write here the output of my .bat")

End Sub

Just for the context, and to help you to understand my needs:

My .bat is using a third party tool to compile my SCSS (an extention of the CSS syntax) and generate the corresponding CSS in a file. When the compilator has finished working, it give an output if everything's is good or if there is some errors. I would like to integrate the message information directly into the output pane, and then automatise the compilation of my SCSS file (on a Ctrl+S for exemple), so I can check almost immediately the results on the browser.

Sorry for my english, you can correct me if needed :-)

Etienne
  • 2,257
  • 3
  • 27
  • 41

1 Answers1

0

Just define your .BAT as an external tool. It has an option to show the output in the output window. You can then assign a keyboard shortcut for it. If you still need to call it from a macro, use syntax:

DTE.ExecuteCommand("Tools.ExternalCommandX")

where X is an order number of your external tool.

Peter Macej
  • 4,831
  • 22
  • 49