BrunoLM
BrunoLM

Reputation: 100381

How to create a button that runs a console application?

I want to add one button on a toolbar in Visual Studio 2010 that will simply execute:

prog -m <mode>

Where <mode> is "Debug" or "Release" depending on the selected option.

What do I need to do it? Do I need to make an extension for VS, how?

Upvotes: 1

Views: 1207

Answers (1)

user180326
user180326

Reputation:

You can configure an "External Tool" from the tools menu, and then you can add a toolbar button that invokes "External Tool n".

I find these external tools very useful. You can pass in variables from the current project/file with the $(VariableName) syntax like you see elsewhere. From the top of my head, Debug/Release is in $(Configuration), but there's a list you can call up from the dialog where you edit External Tools.

Edit: It's actually $(ConfigurationName).

here's the list of all variables available: http://msdn.microsoft.com/en-us/library/c02as0cs(v=vs.71).aspx

Upvotes: 2

Related Questions