If you use Visual Studio’s devenv.exe from a terminal, these switches let you build, clean, run, and troubleshoot solutions without manually driving the IDE. This guide reorganizes the original switch list into practical groups and shows command patterns you can adapt for local scripts and CI tasks.
Originally published on 2009-06-20; fully revised and updated.
Original article: Command line switches of devenv.exe.
How to list switches on your installed version
The most reliable source is the help output from the version installed on your machine:
devenv /?
This is important because switch availability and behavior can differ between Visual Studio releases.
Build and deployment switches
These are the core switches from the original post used for compiling and deployment workflows.
| Switch | Purpose | Dependency | Typical usage |
|---|---|---|---|
| /build | Build the specified solution configuration | None | Standard compile of a solution configuration |
| /project | Build a project instead of the full solution | Use with /build | Target only one project in a larger solution |
| /projectconfig | Specify the project configuration to build | Use with /project | Build a specific project/config pair |
| /rebuild | Clean first, then build | None | Force a full rebuild |
| /clean | Clean build outputs | None | Reset binaries/intermediate outputs |
| /deploy | Build specified solution configuration, then deploy | None | Build-and-deploy sequence |
| /out | Write output to a file | Commonly paired with build-related switches | Persist logs for review |
devenv MySolution.sln /build "Release|Any CPU"
devenv MySolution.sln /build "Release|Any CPU" /project MyProject /projectconfig "Release|Any CPU"
devenv MySolution.sln /rebuild "Debug|Any CPU" /out build.log
devenv MySolution.sln /clean "Release|Any CPU"
devenv MySolution.sln /deploy "Release|Any CPU"Code language: JavaScript (javascript)
Run and command-execution switches
These switches control post-build execution and IDE command invocation.
| Switch | What it does | When to use it |
|---|---|---|
| /run | Run the specified solution configuration | Start after build while keeping environment active |
| /runexit | Run specified solution configuration, then terminate | Non-interactive execution pattern |
| /command | Execute an internal command line after startup | Automate an IDE command at launch |
devenv MySolution.sln /run "Debug|Any CPU"
devenv MySolution.sln /runexit "Debug|Any CPU"
devenv MySolution.sln /command "File.OpenFile"Code language: JavaScript (javascript)
Switch selection workflow
This quick flow helps choose between the most common build/run switches.
flowchart TD
A[Start with solution and config] --> B{Need a clean build}
B -- yes --> C[Use /rebuild]
B -- no --> D[Use /build]
C --> E{Run after build}
D --> E
E -- no --> F[Optionally add /out for logs]
E -- yes --> G{Close after run}
G -- yes --> H[Use /runexit]
G -- no --> I[Use /run]
IDE behavior and recovery switches
The original post also listed switches focused on UI behavior, localization, and startup stability.
- /mditabs — use tabbed documents interface.
- /mdi — use MDI interface.
- /fn — use specified font name.
- /fs — use specified font size.
- /LCID — use specified language ID.
- /noVSIP — disable VSIP developer license key for VSIP testing.
- /safemode — load only default environment/services for stability.
- /resetskippkgs — allow previously skipped VSPackages to load again.
Common command patterns
# Clean, build, and keep a build log
devenv MySolution.sln /clean "Release|Any CPU"
devenv MySolution.sln /build "Release|Any CPU" /out release-build.log
# Build only one project inside the solution
devenv MySolution.sln /build "Release|Any CPU" /project MyProject /projectconfig "Release|Any CPU"
# Run then exit
devenv MySolution.sln /runexit "Debug|Any CPU"
# Troubleshooting startup issues
devenv /safemode
devenv /resetskippkgsCode language: PHP (php)
Common pitfalls
- Using /project without /build.
- Using /projectconfig without /project.
- Forgetting quotes around configuration values like “Release|Any CPU”.
- Assuming all switches behave identically across Visual Studio versions; verify with devenv /? on the target machine.
- Running commands where devenv.exe is not on PATH (use a developer shell or full executable path).
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals

When using devenv.exe commands in automated development workflows, the bigger challenge is not remembering switches but ensuring reliable build execution across different environments. In enterprise setups, command-line builds often run through CI servers where Visual Studio versions, installed extensions, SDK dependencies, and machine configurations can vary. Maintaining a consistent build environment and capturing detailed logs is essential to quickly identify failures that may not appear on a developer machine.
Another important consideration is planning for long-term maintainability. As projects evolve, teams should regularly review whether devenv-based automation is still the right approach or if more lightweight build tools and dedicated build pipelines provide better scalability. Treating build commands as part of the release process with proper version control, validation, and monitoring helps prevent unexpected issues during deployments.