Commands for installing Windows Software Development Kit 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
PowerShell
winget install --id Microsoft.WindowsSDK.10.0.19041 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.WindowsSDK.10.0.19041 -e --silentwinget uninstall --id Microsoft.WindowsSDK.10.0.19041 -e --silentBy installer
32-bit · EXE
Silent install
winsdksetup.exe /qUninstall
msiexec /x {4591FAF1-A2DB-4A3D-BFDA-AA5A4EBB1587} /qn /norestart- MSI product code
- {4591faf1-a2db-4a3d-bfda-aa5a4ebb1587}
- Uninstall registry key
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4591faf1-a2db-4a3d-bfda-aa5a4ebb1587}
- DisplayVersion
- 10.1.19041.685
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-windows-software-development-kit.ps1
$url = 'https://download.microsoft.com/download/4/d/2/4d2b7011-606a-467e-99b4-99550bf24ffc/windowssdk/winsdksetup.exe'
$sha256 = '42D2774274D1135FC598C180C2ACBF2321EB4192F59E511E6AC7772870BF6DE1'
$file = Join-Path $env:TEMP 'winsdksetup.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 '/q' -Wait