Commands for installing Microsoft Visual Studio Code without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
winget install --id Microsoft.VisualStudioCode -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.VisualStudioCode -e --silentwinget uninstall --id Microsoft.VisualStudioCode -e --silentBy installer
64-bit · EXE (Inno Setup) · Current user · en-US
VSCodeUserSetup-x64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-VSCodeUserSetup-x64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\microsoft-visual-studio-code"64-bit · EXE (Inno Setup) · All users · en-US
VSCodeSetup-x64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-VSCodeSetup-x64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\microsoft-visual-studio-code"ARM64 · EXE (Inno Setup) · Current user · en-US
VSCodeUserSetup-arm64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-VSCodeUserSetup-arm64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\microsoft-visual-studio-code"ARM64 · EXE (Inno Setup) · All users · en-US
VSCodeSetup-arm64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-VSCodeSetup-arm64-1.141.2.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /DIR="C:\Apps\microsoft-visual-studio-code"PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
$url = 'https://vscode.download.prss.microsoft.com/dbazure/download/stable/16507d91be0dc1ce4f94c04d4d0430210b8685d9/VSCodeUserSetup-x64-1.141.2.exe'
$sha256 = '9B9E7305BC5F2D9176DFF8263BA146FC7B0D65CE1FB499271FD7746EC53D66ED'
$file = Join-Path $env:TEMP 'VSCodeUserSetup-x64-1.141.2.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait $url = 'https://vscode.download.prss.microsoft.com/dbazure/download/stable/16507d91be0dc1ce4f94c04d4d0430210b8685d9/VSCodeSetup-x64-1.141.2.exe'
$sha256 = '43E9E2DF672BA5CEB500E5CA6304297183AD195A323B8D73C70C7DF2D60E333F'
$file = Join-Path $env:TEMP 'VSCodeSetup-x64-1.141.2.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait $url = 'https://vscode.download.prss.microsoft.com/dbazure/download/stable/16507d91be0dc1ce4f94c04d4d0430210b8685d9/VSCodeUserSetup-arm64-1.141.2.exe'
$sha256 = '7EA3A25FA828C229DC8B79187EA3C6A35178A9243DD9AD1C1A4E6458CD60D8ED'
$file = Join-Path $env:TEMP 'VSCodeUserSetup-arm64-1.141.2.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait $url = 'https://vscode.download.prss.microsoft.com/dbazure/download/stable/16507d91be0dc1ce4f94c04d4d0430210b8685d9/VSCodeSetup-arm64-1.141.2.exe'
$sha256 = '68A31F854F0D1DFF3F17DFE02ACBAD9238B1888DBD5BD344185C067B034B14FD'
$file = Join-Path $env:TEMP 'VSCodeSetup-arm64-1.141.2.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' -Wait