Click here to Skip to main content
15,898,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have developed a control and in order to add it in toolbox, I need to run a command in a command windows at design time in IDE in order to run installCommunityControls like when you do it by opening command window ( View menu -> other windows -> command window ) and then type installCommunityControls, is there any way to do that in c#?
Posted
Updated 6-Sep-13 12:30pm
v2
Comments
Sergey Alexandrovich Kryukov 3-Sep-13 23:25pm    
What do you mean by "command window"? CMD.EXE or something? Why?
—SA
albert sh 3-Sep-13 23:31pm    
when developer pressed ctrl+w+a command windows appears and I need to run tools there.
Sergey Alexandrovich Kryukov 4-Sep-13 1:36am    
Usually, if I press Ctrl+W, before I get a chance to press A, the child window or tab closes. And if I press Ctrl+A, before I get a chance to press W, "Select All" is executed. Come one, what are you even talk about? In what application do you do it? Do you understand yourself what you are asking about?.. :-)
—SA
Dave Kreskowiak 4-Sep-13 7:03am    
Ctrl-W-A in Visual Studio brings up the Command window at the bottom. Honestly, this is the first time I've ever heard of wanting to do this from inside a control at design time.
Sergey Alexandrovich Kryukov 4-Sep-13 12:18pm    
Thank you for a note, this is really so. I didn't really try hard to find it out, by my comment, I wanted to point out weirdness of the problem. Even VS add-ons should not affect layout of the windows. OP should have explained the idea. Even Visual Studio wasn't mentioned.
—SA

1 solution

I only have VisualStudio 2008 on this PC, but perhaps it could be somehow similar on other versions:

1) Create the new entry for your external tool (CMD.exe inthis case).
a) Menu: "Tools->External Tools..."
b) Press the "Add" button to create your external tool entry.
c) Give it the appropiate name (Win Command Console, or whichever you like).
d) Set "Command" to "cmd.exe".
e) Uncheck the "Use Output Window".
f) Select the "Initial Directory" that best suits your needs.

2) Take note of the tool's index in the external tools list. It's '1' based, not zero based.

3) Open the "Options" configuration dialog (Menu: "Tools->Options...").

4) Go to "Environment/Keyboard".

5) In the filter (textbox labeled "Show commands containing:") type "ExternalCommand".
That will show the list of internal macros referencing the external tools.

6) Select the item named "Tools.ExternalCommand" followed by your tool's index.
E.g. if your tool is the third in the external tools list, then the name will be
"Tools.ExternalCommand3".

7) Click on the textbox labeled "Press shortcut keys" and press the shortcut you want.
If the shortcut is already assigned to any other command it will select it in the
list shown bellow the textbox.

It works for me, hope it works for you.
 
Share this answer
 
Comments
albert sh 4-Sep-13 11:08am    
@V.lorz : thanks for your detailed comment but I don't need to do that in my IDE , instead in the IDEs that other developers will use this control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900