Share via


Devenv Command Line Switches

Devenv allows you to set various options for the integrated development environment (IDE) as well as compile, build, and debug projects from the command line. Use these switches to run the IDE from a script or .bat file, such as a nightly build script, or to launch the IDE in a particular configuration.

**Tip   **To have Visual Studio launch and open a single file automatically in an editor, enter the full path and file name after typing Devenv with no additional switches or arguments. For example, devenv "c:\test.cpp".

Devenv Switch Syntax

Switches for Devenv follow syntax rules that are very similar to other DOS command line utilities. Devenv command line switches work for devenv.com and devenv.exe. By default, entering devenv without a file extension passes switches to devenv.com. Using devenv.com provides the correct delivery of output using standard system streams, such as stdout and stderr, and correct I/O redirection for capturing output, such as in a .txt file. To pass switches to devenv.exe, you must specify devenv.exe. All of the syntax rules listed below apply to devenv.com.

Tip   The switch /? displays a list of the available switches in the Command Prompt window for Devenv along with descriptions of their uses.

The following syntax rules apply to all switches and arguments:

  • The command line syntax must start with devenv. For example, to use the /fn switch you would type the following:

    devenv /fn arial
    
  • Switches are not case sensitive.

  • The first argument is typically a solution file name.

  • When you supply a project file name instead of a solution file name, Devenv does the following:

    • Searches the parent directory of the project file for a solution file of the same name. For example, if you specify myproject1.vbproj, Devenv looks for myproject1.sln.
    • Searches for a single solution file with a reference to the project file in the parent directory of the project file. If more than one solution references the project file or no solutions reference the project file, a temporary solution with the same name as the project file is created.
  • File paths and file names that include spaces must be enclosed in double quotation mark ("").

  • Include the drive letter when specifying file paths.

  • Separate multiple switches and arguments with one white space character.

  • Devenv does not accept wildcards or other pattern matching syntax.

Devenv Switches

Use the following command line switches to display the integrated development environment and perform the described task.

Command line switch Description
/lcid or /l Sets the default language for the IDE.
/fn Changes the system font for the IDE.
/fs Changes the system font size for the IDE.
/run or /r Compiles and runs the specified solution.
/runexit Compiles and runs the specified solution, minimizing the IDE when the solution is run, and closing the IDE after the solution has completed running.
/mdi Opens the IDE in multiple-document interface (MDI) mode. In addition, the MDI environment option in the Options dialog box is selected. For more information, see General, Environment, Options Dialog Box.
/mditabs Opens the IDE in MDI mode with the tabs on documents enabled.
/command Starts the IDE and executes the specified command.
/migratesettings Opens the IDE and copies certain Options dialog box settings from a pervious version to the more recent version.
/debugexe Loads a Visual C++ executable under the control of the debugger. This switch is not available for Visual Basic or Visual C# executables. For more information, see Launching the Debugger Automatically.
/useenv Causes the integrated development environment (IDE) to use PATH, INCLUDE, and LIB environment variables for Visual C++ compilation rather than the settings specified in the VC++ Directories section of Projects options in the Options dialog box. For more information, see Setting the Path and Environment Variables for Command-Line Builds

Use the following command line switches to perform the described task. These command line switches do not display the integrated development environment.

Command line switch Description
/build Builds the specified solution or project according to the specified solution configuration.
/rebuild Cleans and then builds the specified solution or project according to the specified solution configuration.
/project The project to build, clean, or deploy. You can use this switch only if you have supplied the /build, /rebuild, /clean, or /deploy switch.
/projectconfig Specifies the project configuration to build or deploy. You can use this switch only if you have supplied the /project switch.
/clean Cleans the specified solution or project according to the specified solution configuration.
/deploy Causes deployment after a build (or a rebuild) according to the specified solution configuration.
/out Allows you to specify a file to receive errors when you build.
/nologo Prevents copyright information from displaying.
/? Displays help inside the Command Prompt window for Devenv switches.

The following switches are available only to those companies who participate in the Visual Studio .NET Integration Program (VSIP).

Command line switch Description
/noVSIP Disables the VSIP developer's license key on a developer workstation.
/safemode Launches Visual Studio in safe mode, loading only the default environment and services.
/resetskippkgs Clears all SkipLoading tags added to VSPackages by users wishing to avoid loading problem VSPackages.

See Also

General, Environment, Options Dialog Box | Visual Studio Commands