The Command Window, like the Immediate Window, can be one of those tools that a developer can find to be an invaluable aid and time saver. As the name implies, the Command Window is essentially a shell into Visual Studio and provides a mechanism other than point-and-click to activate and use Visual Studio’s features.
To start things off, the Command Window (if not already present) can be brought up by using the “Control-Alt-A” keystroke in Visual Studio 2005 and “Control-W A” in Visual Studio 2008.
Though it is available at all times to the developer, lets start off in Debug mode (where I use it the most). For example, you can mimic the Immediate Window by using the Debug.Print command (shown here using the eval and ? shortcuts):

But statement evaluation is just scratching the surface. For example:

Here we can see all the active threads going using Debug.ListThreads.
And of course, IntelliSense is supported:

Outside of Debug mode, almost all of the actions that you would normally perform through the UI via the mouse or keyboard shortcuts, are available via the Command Window. For example, opening a file:

Personally I hate taking my hand off the keyboard. With this, you can issue Control-Alt-A to open (or request focus) the Command Window up, type in your commands, and then hit Escape focus is back (most of the time :)) in your editor.
Some useful shortcuts/utilities built into the window:
??(Debug.QuickWatch) — for example?? xwill setup a QuickWatch onx?(Debug.Print) — as shown above, (evaluate and) Print an expression~(Debug.ListThreads)t(Debug.StepInto)alias— define your own aliaslog— log Command Window output to a file. For example,log /on C:\Debug.txtturns on logging andlog /offturns logging off.
Plus a lot more. I don’t think this post did the power of this feature justice, but the following links can give you a lot more information:
- MSDN: Command Window
- MSDN: Predefined Visual Studio Command Aliases
- Visual Studio Hacks: Master the Command Window
Do you have any good tips or tricks using the Command Window? If so, leave an comment and I will update this post.



March 12th, 2008 at 10:28 pm
Command Window…
You’ve been kicked (a good thing) - Trackback from DotNetKicks.com…
March 14th, 2008 at 5:17 am
Wow! I will bookmark this. I could never figure out the command window. I thought it might be some kind of terminal
March 14th, 2008 at 1:36 pm
[...] The Command Window (nillfm) [...]
March 14th, 2008 at 5:06 pm
[...] eso de silverlight: Desensamblando un proyecto Silverlight 2.0 Beta 1 Esas herramientas perdidas: The Command Window Windows tambiƩn tiene shell: The Windows Command Line, Batch Files, and Scripting Por todos los [...]
March 17th, 2008 at 8:16 pm
[...] The Command Window [...]