← 返回首页
Installing Visual Studio Code on Windows

Documentation

Topics Overview Overview Linux macOS Windows VS Code for the Web Raspberry Pi Network Additional Components Uninstall VS Code Tutorial Copilot Quickstart User Interface Personalize VS Code Install Extensions Tips and Tricks Intro Videos Overview Setup Quickstart Overview Language Models Context Tools Agents Customization Trust & Safety Overview Agents Tutorial Agents Window Planning Memory Tools Subagents Local Agents Copilot CLI Cloud Agents Third-Party Agents Overview Chat Sessions Add Context Inline Chat Review Edits Checkpoints Artifacts Panel Debug Chat Interactions Prompt Examples Overview Instructions Prompt Files Custom Agents Agent Skills Language Models MCP Hooks Plugins Context Engineering Customize AI Test-Driven Development Edit Notebooks with AI Test with AI Test Web Apps with Browser Tools Debug with AI MCP Dev Guide OpenTelemetry Monitoring Inline Suggestions Smart Actions Best Practices Security Troubleshooting FAQ Cheat Sheet Settings Reference MCP Configuration Workspace Context Display Language Layout Keyboard Shortcuts Settings Settings Sync Extension Marketplace Extension Runtime Security Themes Profiles Overview Voice Interactions Command Line Interface Telemetry Basic Editing IntelliSense Code Navigation Refactoring Snippets Overview Multi-Root Workspaces Workspace Trust Tasks Debugging Debug Configuration Testing Port Forwarding Integrated Browser Overview Quickstart Staging & Committing Branches & Worktrees Repositories & Remotes Merge Conflicts Collaborate on GitHub Troubleshooting FAQ Getting Started Tutorial Terminal Basics Terminal Profiles Shell Integration Appearance Advanced Overview Enterprise Policies AI Settings Extensions Telemetry Updates Overview JavaScript JSON HTML Emmet CSS, SCSS and Less TypeScript Markdown PowerShell C++ Java PHP Python Julia R Ruby Rust Go T-SQL C# .NET Swift Working with JavaScript Node.js Tutorial Node.js Debugging Deploy Node.js Apps Browser Debugging Angular Tutorial React Tutorial Vue Tutorial Debugging Recipes Performance Profiling Extensions Tutorial Transpiling Editing Refactoring Debugging Quick Start Tutorial Run Python Code Editing Linting Formatting Debugging Environments Testing Python Interactive Django Tutorial FastAPI Tutorial Flask Tutorial Create Containers Deploy Python Apps Python in the Web Settings Reference Getting Started Navigate and Edit Refactoring Formatting and Linting Project Management Build Tools Run and Debug Testing Spring Boot Modernizing Java Apps Application Servers Deploy Java Apps GUI Applications Extensions FAQ Intro Videos GCC on Linux GCC on Windows GCC on Windows Subsystem for Linux Clang on macOS Microsoft C++ on Windows Build with CMake CMake Tools on Linux CMake Quick Start C++ Dev Tools for Copilot Editing and Navigating Debugging Configure Debugging Refactoring Settings Reference Configure IntelliSense Configure IntelliSense for Cross-Compiling FAQ Intro Videos Get Started Navigate and Edit IntelliCode Refactoring Formatting and Linting Project Management Build Tools Package Management Run and Debug Testing FAQ Overview Node.js Python ASP.NET Core Debug Docker Compose Registries Deploy to Azure Choose a Dev Environment Customize Develop with Kubernetes Tips and Tricks Overview Jupyter Notebooks Data Science Tutorial Python Interactive Data Wrangler Quick Start Data Wrangler PyTorch Support Azure Machine Learning Manage Jupyter Kernels Jupyter Notebooks on the Web Data Science in Microsoft Fabric Foundry Toolkit Overview Foundry Toolkit Copilot Tools Create Agents Models Playground Agent Builder Agent Inspector Evaluation Tool Catalog Fine-Tuning (Automated Setup) Fine-Tuning (Project Template) Model Conversion Tracing Profiling (Windows ML) FAQ File Structure Manual Model Conversion Manual Model Conversion on GPU Setup Environment Without Foundry Toolkit Template Project Migrating from Visualizer to Agent Inspector Overview Getting Started Resources View Deployment VS Code for the Web - Azure Containers Azure Kubernetes Service Kubernetes MongoDB Remote Debugging for Node.js Overview SSH Dev Containers Windows Subsystem for Linux GitHub Codespaces VS Code Server Tunnels SSH Tutorial WSL Tutorial Tips and Tricks FAQ Overview Tutorial Attach to Container Create Dev Container Advanced Containers devcontainer.json Dev Container CLI Tips and Tricks FAQ Default Keyboard Shortcuts Default Settings Substitution Variables Tasks Schema
Copy as Markdown

On this page there are 5 sections

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.

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.

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.