How to Deploy Visual Studio Code via Intune (Win32 Packaging Guide)
Visual Studio Code has a dedicated system installer (separate from the per-user installer) that is the right choice for Intune deployment. The key thing to get right is using the system installer EXE rather than the standard one - the standard installer puts VS Code in the user's AppData folder, which makes Intune detection unreliable.
Download the system installer
VS Code provides a system installer specifically for managed deployments. Download it from:
https://code.visualstudio.com/download
Under Windows, look for the System Installer option (not the User Installer). Download the 64-bit version. The filename will be VSCodeSetup-x64-1.x.x.exe.
Wrap with the Content Prep Tool
IntuneWinAppUtil.exe -c "C:\AppSource\VSCode" -s "VSCodeSetup-x64-1.96.0.exe" -o "C:\IntunePackages"
Add the app in Intune
- Upload the .intunewin file
- Name: Visual Studio Code
- Publisher: Microsoft Corporation
Install and uninstall commands
VS Code uses an Inno Setup installer with the following silent switches:
Detection rule
Deploying extensions
You can pre-install VS Code extensions as part of the Win32 deployment using a PowerShell wrapper script instead of deploying the EXE directly. The script installs VS Code then runs the extension installer:
# install.ps1
$installer = "$PSScriptRoot\VSCodeSetup-x64-1.96.0.exe"
Start-Process $installer -ArgumentList "/VERYSILENT /NORESTART /MERGETASKS=!runcode,addtopath" -Wait
# Install extensions for all users
$codeExe = "C:\Program Files\Microsoft VS Code\bin\code.cmd"
$extensions = @(
"ms-vscode.powershell",
"ms-vscode-remote.remote-ssh"
)
foreach ($ext in $extensions) {
Start-Process $codeExe -ArgumentList "--install-extension $ext --force" -Wait
}Known gotchas
VS Code auto-updating
VS Code updates itself automatically. If you want to manage updates via Intune supersedence instead, add the following registry key post-install to disable auto-update:
REG ADD "HKLM\SOFTWARE\Policies\Microsoft\VSCode" /v "UpdateMode" /t REG_SZ /d "none" /f
Frequently Asked Questions
Use the System Installer with: VSCodeSetup-x64.exe /VERYSILENT /NORESTART /MERGETASKS=!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath. This installs system-wide and adds VS Code to the PATH.
The System Installer installs VS Code to Program Files for all users. The standard User Installer installs to AppData per-user, which makes Intune detection unreliable and prevents system-level management.
Use a PowerShell wrapper script that calls code.cmd --install-extension [extension-id] after installing VS Code. Deploy the script and installer together in the same Intune Win32 package.
Add a registry key post-install: HKLM\SOFTWARE\Policies\Microsoft\VSCode with UpdateMode set to "none". This disables the built-in update check so you can manage versions via Intune supersedence.