Command-line parameter examples for Visual Studio 2017 installation
To illustrate how to use command-line parameters to install Visual Studio, here are several examples that you can customize to match your needs.
In each example,
vs_community.exe represent the respective edition of the Visual Studio bootstrapper,
which is the small (approximately 1MB) file that initiates the download process. If you are using a different edition, substitute the appropriate bootstrapper name.
All commands require administrative elevation, and a User Account Control prompt will be displayed if the process is not started from an elevated prompt.
You can use the
^ character at the end of a command line to concatenate multiple lines into a single command. Alternatively, you can simply place these lines together onto a single row. In PowerShell, the equivalent is the backtick (
` ) character.
Install a minimal instance of Visual Studio, with no interactive prompts but progress displayed:
vs_enterprise.exe --installPath C:\minVS ^ --add Microsoft.VisualStudio.Workload.CoreEditor ^ --passive --norestart
Install a desktop instance of Visual Studio silently, with the French language pack, returning only when the product is installed.
vs_enterprise.exe --installPath C:\desktopVS ^ --addProductLang fr-FR ^ --add Microsoft.VisualStudio.Workload.ManagedDesktop ^ --includeRecommended --quiet --wait
--wait parameter is designed for use in a batch file. In a batch file, execution of the next command will not continue until the installation has completed. The
%ERRORLEVEL% environment variable will contain the return value of the command, as documented in the Use command-line parameters to install Visual Studio page.
- Download the Visual Studio core editor (the most minimal Visual Studio configuration). Only include the English language pack:
vs_community.exe --layout C:\VS2017 --lang en-US ^ --add Microsoft.VisualStudio.Workload.CoreEditor
Download the .NET desktop and .NET web workloads along with all recommended components and the GitHub extension. Only include the English language pack:
vs_community.exe --layout C:\VS2017 ^ --lang en-US ^ --add Microsoft.VisualStudio.Workload.NetWeb ^ --add Microsoft.VisualStudio.Workload.ManagedDesktop ^ --add Component.GitHub.VisualStudio ^ --includeRecommended
Start an interactive installation of all workloads and components that are available in the Visual Studio 2017 Enterprise edition:
vs_enterprise.exe --all --includeRecommended --includeOptional
Install a second, named instance of Visual Studio 2017 Professional on a machine with Visual Studio 2017 Community edition already installed, with support for Node.js development:
vs_professional.exe --installPath C:\VSforNode ^ --add Microsoft.VisualStudio.Workload.Node --includeRecommended --nickname VSforNode
Remove the Profiling Tools component from the default installed Visual Studio instance:
vs_enterprise.exe modify ^ --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise" ^ --remove Microsoft.VisualStudio.Component.DiagnosticTools ^ --passive
Sometimes, things can go wrong. If your Visual Studio installation fails, see the Troubleshooting Visual Studio 2017 installation and upgrade issues page. If none of the troubleshooting steps help, you can contact us by live chat for installation assistance (English only). For details, see the Visual Studio support page.
Here are a few more support options:
- You can report product issues to us via the Report a Problem tool that appears both in the Visual Studio Installer and in the Visual Studio IDE.
- You can share a product suggestion with us on UserVoice.
- You can track product issues in the Visual Studio Developer Community, and ask questions and find answers.
- You can also engage with us and other Visual Studio developers through our Visual Studio conversation in the Gitter community. (This option requires a GitHub account).