Installing Visual Studio Code on Windows

Visual Studio Code is available for Windows through a user installer, a system installer, and a ZIP archive. The User setup is the recommended installation for most people because it does not require administrator permissions and supports smoother background updates.

Install VS Code on Windows

Choose User setup or System setup

VS Code provides both Windows user-level and system-level setups.

Setup type Use when Notes
User setup Install VS Code for your Windows account. This setup does not require administrator permissions. It installs under %LOCALAPPDATA%\Programs\Microsoft VS Code and provides the smoothest update experience. Updates are disabled when VS Code runs as Administrator from a User setup installation.
System setup Install VS Code for all users on the machine. This setup requires administrator permissions and installs under Program Files. In-product updates also require elevation.

See the Download Visual Studio Code page for the full list of installation options.

Install with the Windows installer

  1. Download the Visual Studio Code User setup for Windows.

  2. Run the installer, VSCodeUserSetup-{version}.exe.

    By default, the User setup installs VS Code under C:\Users\{Username}\AppData\Local\Programs\Microsoft VS Code.

Tip

Setup adds Visual Studio Code to your %PATH% environment variable. Restart your console after installation, then run code . in a folder to open that folder in VS Code.

Install with the System setup

  1. Download the Visual Studio Code System setup for Windows.

  2. Run the installer with administrator permissions.

The System setup makes VS Code available to all users on the machine.

Set up the copilot command

Setup can add the copilot command to your %PATH% environment variable, so you can run GitHub Copilot CLI from any terminal. Copilot CLI is a separate GitHub product with its own license terms, and it requires a GitHub Copilot subscription.

When Copilot CLI isn't installed, the User setup shows the GitHub Copilot CLI page with these options:

  • Install GitHub Copilot CLI now: Setup adds copilot to %PATH%. After it installs VS Code, it downloads Copilot CLI from GitHub and installs it.
  • Install GitHub Copilot CLI when I first run copilot: Setup adds copilot to %PATH%. Nothing is downloaded until you run copilot and confirm the installation.
  • Don't add the copilot command: Setup doesn't add copilot to %PATH%. You can still run copilot in the VS Code integrated terminal.

The System setup offers only to add the command for all users or not. In that case, copilot asks each user before it downloads Copilot CLI the first time they run it. When the User setup can't reach GitHub, it also offers only to add the command or not.

Setup skips the page when Copilot CLI is already installed, when you run the User setup as an administrator, or when an administrator disables the copilot command with a policy.

Updates keep your choice and never download Copilot CLI. To change your choice, run setup again. Copilot CLI updates itself, and uninstalling VS Code doesn't remove Copilot CLI or its data.

Tip

Open a new terminal after setup to use the copilot command.

Install from a ZIP archive

  1. Download the Visual Studio Code ZIP archive for Windows.

  2. Extract the ZIP archive and run VS Code from the extracted folder.

Note

When VS Code is installed from a ZIP archive, update it manually for each release.

Updates

VS Code ships weekly releases and supports auto-update when a new release is available. When VS Code prompts you for an update, accept the prompt to install the new version.

Note

Disable auto-update if you prefer to update VS Code on your own schedule.

Develop on Windows

Windows works well as a cross-platform development environment. This section covers the Windows Subsystem for Linux (WSL) and Windows Terminal.

Note

Keep Windows up to date. Check Settings > Windows Update for available updates.

Windows Subsystem for Linux

With WSL, install and run Linux distributions on Windows to develop and test source code on Linux while working locally on your Windows machine.

When paired with the WSL extension, VS Code provides editing and debugging support while running in the context of WSL.

See the Developing in WSL documentation to learn more, or try the Working in WSL introductory tutorial.

Windows Terminal

Windows Terminal, available from the Microsoft Store, is a terminal application for command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU-accelerated text rendering engine, custom themes, styles, and configurations.

After installation

After you install VS Code, finish setup for your development workflow:

Common questions

What command-line arguments are supported by Windows Setup?

VS Code uses Inno Setup to create its Windows setup package. All Inno Setup command-line switches are available.

To prevent Setup from launching VS Code after completion, use /mergetasks=!runcode.

To choose how Setup sets up the copilot command in a silent installation, use /copilotcli=install, /copilotcli=onfirstuse, or /copilotcli=none. These values match the options on the GitHub Copilot CLI page. With install, the System setup adds the command without installing Copilot CLI. Without this switch, Setup adds copilot to %PATH% when it also adds VS Code to %PATH%, unless you made a different choice in an earlier installation. Setup doesn't download Copilot CLI unless you use /copilotcli=install.

I'm having trouble with the installer

Use the ZIP archive instead of the installer. To use this installation method, unzip VS Code in your AppData\Local\Programs folder.

Unable to run as admin when AppLocker is enabled

With the introduction of process sandboxing, running as administrator is currently unsupported when AppLocker is configured due to a runtime sandbox limitation. Read the VS Code sandbox blog post for more information.

If your work requires VS Code to run from an elevated terminal:

  1. In VS Code, run the Preferences: Configure Runtime Arguments command in the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)).

    This command opens an argv.json file to configure runtime arguments for VS Code. The file might already contain default arguments.

  2. Add "disable-chromium-sandbox": true to the argv.json file.

  3. Restart VS Code. VS Code can then run from an elevated terminal.

Subscribe to issue #122951 to receive updates.

Working with UNC paths

As of version 1.78.1, VS Code on Windows only opens UNC paths that are either approved by the user on startup or whose host name is configured through the security.allowedUNCHosts Open in VS Code Open in VS Code Insiders setting. UNC paths begin with a leading \\.

If your workflow relies on UNC paths in VS Code, use one of these options:

  • Configure the host with the security.allowedUNCHosts Open in VS Code Open in VS Code Insiders setting. For example, add server-a when opening a path such as \\server-a\path.
  • Map the UNC path as a network drive, and use the drive letter instead of the UNC path.
  • Define a global environment variable named NODE_UNC_HOST_ALLOWLIST with a backslash-separated list of permitted host names. For example, server-a\server-b permits the hosts server-a and server-b.
Note

If a remote extension connects to a remote workspace, such as with SSH, configure security.allowedUNCHosts Open in VS Code Open in VS Code Insiders on the remote machine, not on the local machine.

This change improves security when using VS Code with UNC paths. See the associated security advisory for more information.