Commands for installing Rust (MSVC) 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 Rustlang.Rust.MSVC -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Rustlang.Rust.MSVC -e --silentwinget uninstall --id Rustlang.Rust.MSVC -e --silentBy installer
64-bit · MSI · All users
Silent install
msiexec /i rust-1.100.0-x86_64-pc-windows-msvc.msi /qn /norestartWrite a log
msiexec /i rust-1.100.0-x86_64-pc-windows-msvc.msi /qn /norestart /l*v "%TEMP%\rust-msvc-install.log"Uninstall
msiexec /x {011DFD9D-4722-4359-82E4-148544BA4D87} /qn /norestart- MSI product code
- {011DFD9D-4722-4359-82E4-148544BA4D87}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{011DFD9D-4722-4359-82E4-148544BA4D87}
- UpgradeCode
- {123039F9-68E3-44F1-AC9F-C78ADD4D0723}
- Install folder
- %ProgramFiles%\Rust
ARM64 · MSI · All users
Silent install
msiexec /i rust-1.100.0-aarch64-pc-windows-msvc.msi /qn /norestartWrite a log
msiexec /i rust-1.100.0-aarch64-pc-windows-msvc.msi /qn /norestart /l*v "%TEMP%\rust-msvc-install.log"Uninstall
msiexec /x {48976541-87FD-440A-9B66-93C0DCF09B19} /qn /norestart- MSI product code
- {48976541-87FD-440A-9B66-93C0DCF09B19}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{48976541-87FD-440A-9B66-93C0DCF09B19}
- UpgradeCode
- {5805719C-45E9-4CF6-9CE7-1E8B57F3C243}
- Install folder
- %ProgramFiles(x86)%\Rust
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-rust-msvc.ps1
$url = 'https://static.rust-lang.org/dist/rust-1.100.0-x86_64-pc-windows-msvc.msi'
$sha256 = '568293AB9147509F794DC09B6CA6C54FF8F1699644FB39D710FFC5CFB7F33A9B'
$file = Join-Path $env:TEMP 'rust-1.100.0-x86_64-pc-windows-msvc.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-rust-msvc.ps1
$url = 'https://static.rust-lang.org/dist/rust-1.100.0-aarch64-pc-windows-msvc.msi'
$sha256 = '99C432FF23EC67FFB356E9762CF1CD2FBA975350F83DF4596A1CC5F32B14CDF2'
$file = Join-Path $env:TEMP 'rust-1.100.0-aarch64-pc-windows-msvc.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait