views:

606

answers:

1

This may seem silly to some but I've never really understood the usefulness of the Command Window in Visual Studio.

I know that the Visual Studio Command Window is used to execute commands or aliases directly in the IDE. The MSDN article explains how one can use the command window to print debug statements but I feel that these can be easier executed in the Immediate Window.

So my question is does anyone actually use the Command Window and if so what for?

+2  A: 

The Immediate window is mostly used for debugging, variable evaluation etc. You sound familiar with it so I won't belabor its usage. For more info on it check out this link.

The Command window allows you to execute a variety of commands using their aliases. You'll notice that the command window prompt has a > character. You can open a file in your solution using of Class1.cs, hit enter, and open it up. In the Find dialog and Immediate window you would need to include the >, making it >of Class1.cs.

Nonetheless, you can do exactly the same thing in the Immediate window by prefixing a command with > as well. The Command window saves you an extra keystroke and is ready to go whenever you drop a command alias.

Check out these links for some commands:

For example, to open the Quick Watch window, type ?? in the command window. Try that in the Immediate window and you'll get:

??
Invalid expression term '?'

Type >?? in the Immediate window and it'll work.

Ahmad Mageed