Devenv Command Line Switches
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Devenv Command Line Switches 

Devenv allows you to set various options for the integrated development environment (IDE) as well as build, debug, and deploy 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.


To have Visual Studio launch a single file and open it in an appropriate editor, enter devenv followed by the full path and file name, with no additional switches or arguments. For example, devenv "c:\test.cpp".

By default, devenv commands pass switches to the utility.


Use the command devenv /? to display a list of all available devenv switches in the Command window, with descriptions of their uses.

The utility provides for the delivery of output via standard system streams, such as stdout and stderr, and determines the proper I/O redirection when capturing output, such as to a .txt file.

The syntax rules for devenv switches are very similar to those followed by other DOS command line utilities. The following syntax rules apply to all devenv switches and their arguments:

  • Commands begin with devenv. For example, the command devenv /fn verdana specifies Verdana as the default system font for the IDE.


    Commands that begin instead with devenv.exe can use the same switches, but will send them directly to the devenv.exe program, bypassing the utility.

  • Switches are not case sensitive.

  • The first argument will often be a solution file name.

  • When you supply a project file name instead of a solution file name, a devenv command will search the parent folder of the project file for a solution file with the same name. For example, the command devenv /build myproject1.vbproj will search the parent folder for a solution file named "myproject1.sln".


    One and only one solution file that references this project should exist in its parent folder. If the parent folder contains no solution file that references this project, or if the parent folder contains two or more solution files that reference it, then a temporary solution file will be created there that is named for and references this project.

  • When file paths and file names include spaces, you must enclose them in double quotation mark ("").

  • When specifying file paths, you must include the drive letter.

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

  • You cannot use wildcards or other pattern matching syntax in devenv commands.

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

Command line switch Description


Starts the IDE and executes the specified command.


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 How to: Launch the Debugger Automatically.

/LCID or /l

Sets the default language for the IDE.


Starts Visual Studio and logs all activity to the specified log file for troubleshooting.

/Run or /r

Compiles and runs the specified solution.


Compiles and runs the specified solution, minimizing the IDE when the solution is run, and closing the IDE after the solution has completed running.


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 IDE.

Command line switch Description


Displays help inside the Command Prompt window for Devenv switches.


Builds the specified solution or project according to the specified solution configuration.


Cleans the specified solution or project according to the specified solution configuration.


Causes deployment after a build (or a rebuild) according to the specified solution configuration.


Registers project or item templates that are located in <VisualStudioInstallDir>\Common7\IDE\ProjectTemplates or <VisualStudioInstallDir>\Common7\IDE\ItemTemplates so they can be accessed through the New Project and Add New Item dialog boxes.


Allows you to specify a file to receive errors when you build.


The project to build, clean, or deploy. You can use this switch only if you have supplied the /build, /rebuild, /clean, or /deploy switch.


Specifies the project configuration to build or deploy. You can use this switch only if you have supplied the /project switch.


Cleans and then builds the specified solution or project according to the specified solution configuration.


Updates the solution file and all of its project files, or the project file specified, to the current Visual Studio 2005 formats for these files.

The following switches can be used by companies who participate in the Visual Studio Industry Partner (VSIP) program.

Command line switch Description


Disables the VSIP developer's license key on a developer workstation.


Launches Visual Studio in safe mode, loading only the default environment and services, and shipped versions of third party packages.


Clears all SkipLoading tags added to VSPackages by users wanting to avoid loading problem VSPackages.


Forces Visual Studio to merge resource metadata that describes menus, toolbars, and command groups from all VSPackages available.

© 2015 Microsoft