免互動安裝Microsoft .NET Runtime 9.0、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Microsoft.DotNet.Runtime.9 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.DotNet.Runtime.9 -e --silentwinget uninstall --id Microsoft.DotNet.Runtime.9 -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-9.0.22-win-x64.exe /quiet解除安裝
msiexec /x {82588CAC-50D6-47DF-A52A-FB36A4446C49} /qn /norestart- MSI產品代碼
- {82588cac-50d6-47df-a52a-fb36a4446c49}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{82588cac-50d6-47df-a52a-fb36a4446c49}
- DisplayVersion
- 9.0.22.36622
ARM64 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-9.0.22-win-arm64.exe /quiet解除安裝
msiexec /x {65973860-C4C9-45E7-89C2-44E06F8F5BAE} /qn /norestart- MSI產品代碼
- {65973860-c4c9-45e7-89c2-44e06f8f5bae}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{65973860-c4c9-45e7-89c2-44e06f8f5bae}
- DisplayVersion
- 9.0.22.36622
32位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-9.0.22-win-x86.exe /quiet解除安裝
msiexec /x {1C34F72B-77D5-4ED5-AF7D-6B22CB81147E} /qn /norestart- MSI產品代碼
- {1c34f72b-77d5-4ed5-af7d-6b22cb81147e}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1c34f72b-77d5-4ed5-af7d-6b22cb81147e}
- DisplayVersion
- 9.0.22.36622
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-microsoft-net-runtime-9-0.ps1
$url = 'https://download.microsoft.com/download/cbe1e657-901f-43fe-a473-1274af93b694/f76afc7a-1ebd-4b9b-beb9-92d0b872b5d8/dotnet-runtime-9.0.22-win-x64.exe'
$sha256 = 'C0327DAF307C18F23515735BAE8A1C2EE3881B317F6DD1AAAE867B852B8235A6'
$file = Join-Path $env:TEMP 'dotnet-runtime-9.0.22-win-x64.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 '/quiet' -Wait install-microsoft-net-runtime-9-0.ps1
$url = 'https://download.microsoft.com/download/cbe1e657-901f-43fe-a473-1274af93b694/b2e3f54a-3244-4547-b545-c0b20ad07c2a/dotnet-runtime-9.0.22-win-arm64.exe'
$sha256 = '466564277BEE05977F5162161762D15F4F81158DF8C9A858AE0C84A2FBDCF05A'
$file = Join-Path $env:TEMP 'dotnet-runtime-9.0.22-win-arm64.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 '/quiet' -Wait install-microsoft-net-runtime-9-0.ps1
$url = 'https://download.microsoft.com/download/cbe1e657-901f-43fe-a473-1274af93b694/17ce3ff9-537d-4f65-b60a-5a43af39ca9f/dotnet-runtime-9.0.22-win-x86.exe'
$sha256 = 'E38CA2CFC29915D2845DBCE54FBC04F40133F0A451C3C1115D9A333415D0983C'
$file = Join-Path $env:TEMP 'dotnet-runtime-9.0.22-win-x86.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 '/quiet' -Wait