Commands for installing Windows SDK 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.17134 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.WindowsSDK.10.0.17134 -e --silentwinget uninstall --id Microsoft.WindowsSDK.10.0.17134 -e --silentBy installer
32-bit · EXE (WiX Burn) · All users
Silent install
winsdksetup.exe /qUninstall
msiexec /x {5F83CCDA-0498-4B97-A298-16A642BF49F2} /qn /norestart- MSI product code
- {5F83CCDA-0498-4B97-A298-16A642BF49F2}
- Uninstall registry key
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{5F83CCDA-0498-4B97-A298-16A642BF49F2}
- UpgradeCode
- {6D9EE685-40C2-4292-F6D6-F60F00BC91C8}
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-windows-sdk.ps1
$url = 'https://download.microsoft.com/download/5/A/0/5A08CEF4-3EC9-494A-9578-AB687E716C12/windowssdk/winsdksetup.exe'
$sha256 = '93C9DCA3A9F28061A601F3E6B737DEDE40C2C77CFD200ED5CB6EFE2AB0C9D5CC'
$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