Task | Solution | Example |
---|---|---|
Evaluate an expression. |
Preface the expression with a question mark (?). |
? a+b |
Temporarily enter Command mode while in Immediate mode (to execute a single command). |
Enter the command, prefacing it with a greater than sign (>). |
>alias |
Switch to the Command window. |
Enter cmd into the window, prefacing it with a greater than sign (>). |
>cmd |
Switch back to the Immediate window. |
Enter immed into the window without the greater than sign (>). |
immed |
The Command window is used to execute commands or aliases directly in the Visual Studio integrated development environment (IDE). You can execute both menu commands and commands that do not appear on any menu. To display theCommand window, choose Other Windows from theView menu, and select Command Window.
This section explains the commands and aliases available from the Command window.
Task |
Solution |
Example |
---|---|---|
Evaluate an expression. |
Preface the expression with a question mark (?). |
? myvar |
Switch to an Immediate window. |
Enter immed into the window without the greater than sign (>) |
immed |
Switch back to the Command window from an Immediate window. |
Enter cmd into the window. |
>cmd |
The following shortcuts help you navigate while in Command mode.
The window used to enter the EvaluateStatement command determines whether an equals sign (=) is interpreted as a comparison operator or as an assignment operator.
In the Command window, an equals sign (=) is interpreted as a comparison operator. You cannot use assignment operators in theCommand window. So, for example, if the values of variablesvarA and varB are different, then the command
>Debug.EvaluateStatement(varA=varB)
will return a value of False.
In the Immediate window, by contrast, an equals sign (=) is interpreted as an assignment operator. So, for example, the command
>Debug.EvaluateStatement(varA=varB)
will assign to variable varA the value of variable varB.
Command Name |
Alias |
Complete Name |
---|---|---|
Print Command |
? |
Debug.Print |
Quick Watch Command |
?? |
Debug.Quickwatch |
Add New Project |
AddProj |
File.AddNewProject |
Alias Command |
Alias |
Tools.Alias |
Autos window |
Autos |
Debug.Autos |
Breakpoints window |
bl |
Debug.Breakpoints |
Toggle Breakpoint |
bp |
Debug.ToggleBreakPoint |
Call Stack window |
CallStack |
Debug.CallStack |
Clear Bookmarks |
ClearBook |
Edit.ClearBookmarks |
Close |
Close |
File.Close |
Close All Documents |
CloseAll |
Window.CloseAllDocuments |
Clear All |
cls |
Edit.ClearAll |
Command mode |
cmd |
View.CommandWindow |
View Code |
code |
View.ViewCode |
List Memory Command |
d |
Debug.ListMemory |
List Memory Command as ANSI |
da |
Debug.ListMemory /Ansi |
List Memory Command One Byte format |
db |
Debug.ListMemory /Format:OneByte |
List Memory Command as ANSI with Four Byte format |
dc |
Debug.ListMemory /Format:FourBytes /Ansi |
List Memory Command Four Byte format |
dd |
Debug.ListMemory /Format:FourBytes |
Delete to BOL |
DelBOL |
Edit.DeleteToBOL |
Delete to EOL |
DelEOL |
Edit.DeleteToEOL |
Delete Horizontal Whitespace |
DelHSp |
Edit.DeleteHorizontalWhitespace |
View Designer |
designer |
View.ViewDesigner |
List Memory Command Float format |
df |
Debug.ListMemory/Format:Float |
Disassembly window |
disasm |
Debug.Disassembly |
List Memory Command Eight Byte format |
dq |
Debug.ListMemory /Format:EightBytes |
List Memory Command as Unicode |
du |
Debug.ListMemory /Unicode |
Evaluate Statement Command |
eval |
Debug.EvaluateStatement |
Exit |
Exit |
File.Exit |
Format Selection |
format |
Edit.FormatSelection |
Full Screen |
FullScreen |
View.FullScreen |
Start Command |
g |
Debug.Start |
Go To Command |
GotoLn |
Edit.GoTo |
Go to Brace |
GotoBrace |
Edit.GotoBrace |
F1Help |
Help |
Help.F1Help |
Immediate Mode |
immed |
Tools.ImmediateMode |
Insert File as Text |
InsertFile |
Edit.InsertFileAsText |
List Call Stack Command |
kb |
Debug.ListCallStack |
Make Lower Case |
Lcase |
Edit.MakeLowercase |
Cut Line |
LineCut |
Edit.LineCut |
Delete Line |
LineDel |
Edit.LineDelete |
List Members |
ListMembers |
Edit.ListMembers |
Locals window |
Locals |
Debug.Locals |
Log Command Window Output Command |
Log |
Tools.LogCommandWindowOutput |
Command Window Mark Mode |
mark |
Tools.CommandWindowMarkMode |
Memory window |
Memory Memory1 |
Debug.Memory1 |
Memory Window 2 |
Memory2 |
Debug.Memory2 |
Memory Window 3 |
Memory3 |
Debug.Memory3 |
Memory Window 4 |
Memory4 |
Debug.Memory4 |
Set Radix Command |
n |
Debug.SetRadix |
ShowWebBrowser Command |
nav navigate |
View.ShowWebBrowser |
Next Bookmark |
NextBook |
Edit.NextBookmark |
New File Command |
nf |
File.NewFile |
New Project |
np NewProj |
File.NewProject |
Open File Command |
of Open |
File.OpenFile |
Open Project Command |
op |
File.OpenProject |
Collapse to Definitions/Stop Outlining |
OutlineDefs StopOutlining |
Edit.CollapsetoDefinitions |
Step Over |
p |
Debug.StepOver |
Parameter Information |
ParamInfo |
Edit.ParameterInfo |
Step Out |
pr |
Debug.StepOut |
Previous Bookmark |
PrevBook |
Edit.PreviousBookmark |
Print File |
|
File.Print |
Properties Window |
props |
View.PropertiesWindow |
Stop |
q |
Debug.StopDebugging |
Redo |
redo |
Edit.Redo |
Registers window |
registers |
Debug.Registers |
Run to Cursor |
rtc |
Debug.RunToCursor |
Save Selected Items |
save |
File.SaveSelectedItems |
Save All |
SaveAll |
File.SaveAll |
Save As |
SaveAs |
File.SaveSelectedItemsAs |
Shell Command |
shell |
Tools.Shell |
Stop Find In Files |
StopFind |
Edit.FindInFiles /stop |
Swap Anchor |
SwapAnchor |
Edit.SwapAnchor |
Step Into |
t |
Debug.StepInto |
Tabify Selection |
tabify |
Edit.TabifySelection |
Tasklist window |
TaskList |
View.TaskList |
Threads window |
Threads |
Debug.Threads |
Tile Horizontally |
TileH |
Window.TileHorizontally |
Tile Vertically |
TileV |
Window.TileVertically |
Toggle Bookmark |
ToggleBook |
Edit.ToggleBookmark |
Toolbox window |
toolbox |
View.Toolbox |
List Disassembly Command |
u |
Debug.ListDisassembly |
Make Uppercase |
Ucase |
Edit.MakeUppercase |
Undo |
undo |
Edit.Undo |
Untabify Selection |
Untabify |
Edit.UntabifySelection |
Watch window |
Watch |
Debug.WatchN |
Toggle Word Wrap |
WordWrap |
Edit.ToggleWordWrap |
List Processes |
| |
Debug.ListProcesses |
List Threads Command |
~ ~*k ~*kb |
Debug.ListThreads Debug.ListTheads /AllThreads |
Open the Command window or place the focus in the Find/Command box.
Type >alias, then the name for the alias, followed by the command you want to create an alias for. For example:
>alias MyAlias File.NewFile MyFile
Press ENTER.
The status bar displays the text "Alias <aliasname> created". The new alias now appears in the auto-completion list for commands.
Open the Command window or place the focus in the Find/Command box.
Type >alias, then the name of the alias, followed by/delete. For example:
>alias myalias /delete
Press ENTER.
The status bar displays the text "Alias <aliasname> deleted".
In the Command window, type >alias and press ENTER.
A list of the current Visual Studio command aliases appears, including the definitions for the aliases. You can then print the contents of theCommand window.
Tip |
---|
To clear the contents of the Command window, type >cls. |
In the Command window, type >alias followed by the alias name.
Visual Studio Edition |
Visual Basic |
C# |
C++ |
J# |
Express |
No |
No |
No |
No |
Standard |
Yes |
Yes |
No |
Yes |
Pro/Team |
Yes |
Yes |
No |
Yes |