Delen via


Visual Studio commands

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can enter Visual Studio commands in the Command window, Immediate window, or Find/Command box. In each case, the greater than sign (>) indicates that a command, rather than a search or debug operation, follows.

You can find a complete list of commands and their syntax on the Keyboard page in Tools > Options > Environment.

In localized versions of the IDE, command names can be entered either in the native language of the IDE or in English. For example, you can type either File.NewFile or Fichier.NouveauFichier in the French IDE to execute the same command.

Many commands have aliases. For a list of command aliases, see Command aliases. For command keyboard shortcuts, see Default keyboard shortcuts in Visual Studio.

Escape character

The escape character for Visual Studio commands is a caret (^). The escape character means that the character immediately following it is interpreted literally rather than as a control character. This can be used to embed straight quotation marks ("), spaces, leading slashes, carets, or any other literal characters in a parameter or switch value, with the exception of switch names. For example:

>Edit.Find ^^t /regex

A caret functions the same whether it is inside or outside quotation marks. If a caret is the last character on the line, it's ignored.

Commands with arguments

The following commands take arguments or switches:

Command Name Description
Add Existing Item Adds an existing file to the current solution and opens it.
Add Existing Project Adds an existing project to the current solution.
Alias Creates a new alias for a complete command, complete command and arguments, or even another alias.
Evaluate Statement Evaluates and displays the given statement.
Find Searches files using a subset of the options available on the Find and Replace control.
Find in Files Searches files using a subset of the options available on the Find in Files.
Go To Moves the cursor to the specified line.
List Call Stack Displays the current call stack.
List Disassembly Begins the debug process and allows you to specify how errors are handled.
List Memory Displays the contents of the specified range of memory.
List Modules Lists the modules for the current process.
List Registers Displays a list of registers.
List Source Displays the specified lines of source code.
List Threads Displays a list of the threads in the current program.
Log Command Window Output Copies all input and output from the Command window into a file.
New File Creates a new file and adds it to the currently selected project.
Open File Opens an existing file and allows you to specify an editor.
Open Project Opens an existing project and allows you to add the project to the current solution.
Print Evaluates the expression and displays the results or the specified text.
Quick Watch Command Displays the selected or specified text in the Expression field of the Quick Watch dialog box.
Replace Replaces text in files using a subset of the options available on the Find and Replace control.
Replace in Files Replaces text in files using a subset of the options available in the Replace in Files.
Set Current Stack Frame Allows you to view a particular stack frame.
Set Current Thread Allows you to view a particular thread.
Set Radix Determines the number of bytes to view.
Shell Launches programs from within Visual Studio as though the command has been executed from the command prompt.
ShowWebBrowser Command Displays the URL you specify in a web browser window either within the integrated development environment (IDE) or external to the IDE.
Start Begins the debug process and allows you to specify how errors are handled.
Path Sets the list of directories for the debugger to search for symbols.
Toggle Breakpoint Turns the breakpoint either on or off, depending on its current state, at the current location in the file.
Watch Command Creates and opens a specified instance of a Watch window.

See also