免互動安裝Microsoft .NET Runtime 8.0、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Microsoft.DotNet.Runtime.8 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.DotNet.Runtime.8 -e --silentwinget uninstall --id Microsoft.DotNet.Runtime.8 -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-8.0.33-win-x64.exe /quiet解除安裝
msiexec /x {020C93EE-59E0-4340-A87C-53E70BDD2374} /qn /norestart- MSI產品代碼
- {020c93ee-59e0-4340-a87c-53e70bdd2374}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{020c93ee-59e0-4340-a87c-53e70bdd2374}
- DisplayVersion
- 8.0.33.36622
ARM64 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-8.0.33-win-arm64.exe /quiet解除安裝
msiexec /x {EB95DC93-2BC8-4984-B6AF-BFD593543136} /qn /norestart- MSI產品代碼
- {eb95dc93-2bc8-4984-b6af-bfd593543136}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{eb95dc93-2bc8-4984-b6af-bfd593543136}
- DisplayVersion
- 8.0.33.36622
32位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-8.0.33-win-x86.exe /quiet解除安裝
msiexec /x {0909C92F-E157-4C3E-855D-C418DCF709B6} /qn /norestart- MSI產品代碼
- {0909c92f-e157-4c3e-855d-c418dcf709b6}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0909c92f-e157-4c3e-855d-c418dcf709b6}
- DisplayVersion
- 8.0.33.36622
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-microsoft-net-runtime-8-0.ps1
$url = 'https://download.microsoft.com/download/ee69e3b0-0ec6-429a-82db-70c18a6a445b/5b11d1c2-2aec-48ed-b0dc-7ff4793201a6/dotnet-runtime-8.0.33-win-x64.exe'
$sha256 = '00AE8B7BAB1E8DE69162AEBBCC518789CCDCAD1BD98AFF4F08556812604867EA'
$file = Join-Path $env:TEMP 'dotnet-runtime-8.0.33-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-8-0.ps1
$url = 'https://download.microsoft.com/download/ee69e3b0-0ec6-429a-82db-70c18a6a445b/3932e9cf-9efa-402e-ad3f-d1783bc5fc1c/dotnet-runtime-8.0.33-win-arm64.exe'
$sha256 = '80D1D8892E5465FD44D9335ABCB344EA2AA35534B2C885FF7372F44662AC50EB'
$file = Join-Path $env:TEMP 'dotnet-runtime-8.0.33-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-8-0.ps1
$url = 'https://download.microsoft.com/download/ee69e3b0-0ec6-429a-82db-70c18a6a445b/220d5d9f-6542-485f-99c3-6038d885986f/dotnet-runtime-8.0.33-win-x86.exe'
$sha256 = 'DFBF5DCA6A6C37A1EE316E37227F2AAA6E0BE3A42305534636AD8E2C6C980294'
$file = Join-Path $env:TEMP 'dotnet-runtime-8.0.33-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