Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.75 KB

command-devenv-exe.md

File metadata and controls

57 lines (39 loc) · 1.75 KB
title description ms.date ms.topic helpviewer_keywords author ms.author manager ms.subservice
-Command (devenv.exe)
Learn how to use the Command devenv command-line switch to execute a specified command after launching the Visual Studio IDE.
12/10/2018
reference
Devenv, /Command switch
/Command Devenv switch
Command Devenv switch
ghogen
ghogen
mijacobs
general-ide

/Command (devenv.exe)

Executes the specified command after launching the Visual Studio IDE.

Syntax

devenv /Command CommandName

Arguments

CommandName

Required. The complete name of a Visual Studio command or its alias, enclosed in double quotation marks. For more information about command and alias syntax, see Visual Studio Commands.

Remarks

After startup is complete, the IDE executes the named command.

If an add-in exposes a command, you can use this switch to launch the add-in from the command line. For more information, see How to: Control add-ins by using the add-in manager.

Example

The first example launches Visual Studio and automatically runs the macro Open Favorite Files.

The second example opens a web browsing tab within the IDE and navigates to the Microsoft Learn site.

The third example creates a new file called some_file.cs and opens it in a code editor.

devenv /command "Macros.MyMacros.Module1.OpenFavoriteFiles"

devenv /command "navigate https://learn.microsoft.com/"

devenv /command "nf some_file.cs"

See also