Export (0) Print
Expand All

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.

NoteTip

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 devenv.com utility.

NoteTip

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

The devenv.com 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.

    NoteNote

    Commands that begin instead with devenv.exe can use the same switches, but will send them directly to the devenv.exe program, bypassing the devenv.com 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".

    NoteNote

    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

/Command

Starts the IDE and executes the specified command.

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

/LCID or /l

Sets the default language for the IDE.

/Log

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

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

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

Command line switch Description

/?

Displays help inside the Command Prompt window for Devenv switches.

/Build

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

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

/InstallVSTemplates

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.

/Out

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

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

/Rebuild

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

/Upgrade

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

/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, and shipped versions of third party packages.

/ResetSkipPkgs

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

/Setup

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

Community Additions

ADD
Show:
© 2014 Microsoft