免互動安裝Microsoft .NET Runtime 11.0、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Microsoft.DotNet.Runtime.11 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.DotNet.Runtime.11 -e --silentwinget uninstall --id Microsoft.DotNet.Runtime.11 -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-11.0.0-win-x64.exe /quiet解除安裝
msiexec /x {405628AA-61AE-4306-B41A-6E3437729610} /qn /norestart- MSI產品代碼
- {405628AA-61AE-4306-B41A-6E3437729610}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{405628AA-61AE-4306-B41A-6E3437729610}
- DisplayVersion
- 11.0.0.36629
ARM64 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-11.0.0-win-arm64.exe /quiet解除安裝
msiexec /x {58574F21-0D49-4206-B794-D51DAB7FA42F} /qn /norestart- MSI產品代碼
- {58574F21-0D49-4206-B794-D51DAB7FA42F}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{58574F21-0D49-4206-B794-D51DAB7FA42F}
- DisplayVersion
- 11.0.0.36629
32位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
dotnet-runtime-11.0.0-win-x86.exe /quiet解除安裝
msiexec /x {CE904AAA-F3B6-4E80-ABAD-01E56A1AF01B} /qn /norestart- MSI產品代碼
- {CE904AAA-F3B6-4E80-ABAD-01E56A1AF01B}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CE904AAA-F3B6-4E80-ABAD-01E56A1AF01B}
- DisplayVersion
- 11.0.0.36629
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-microsoft-net-runtime-11-0.ps1
$url = 'https://download.microsoft.com/download/4cb27df5-864a-482d-b5b2-63e1bce4d619/dcb07ce7-a283-4a5d-8b42-194313d57f69/dotnet-runtime-11.0.0-win-x64.exe'
$sha256 = '7338C0BF3895EBFC03C03A37F99B13B6CF558C85709534439F76D61A2CA1289F'
$file = Join-Path $env:TEMP 'dotnet-runtime-11.0.0-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-11-0.ps1
$url = 'https://download.microsoft.com/download/4cb27df5-864a-482d-b5b2-63e1bce4d619/68f89ae9-92ce-498f-99db-b362401eb807/dotnet-runtime-11.0.0-win-arm64.exe'
$sha256 = 'BA7F8D7878C0860A5FD69636C93B58C382B0FC37CDAFE67E933DD1C0FA43DE9F'
$file = Join-Path $env:TEMP 'dotnet-runtime-11.0.0-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-11-0.ps1
$url = 'https://download.microsoft.com/download/4cb27df5-864a-482d-b5b2-63e1bce4d619/6bdc6501-644a-43ac-9d14-bbf8ff69fae4/dotnet-runtime-11.0.0-win-x86.exe'
$sha256 = 'CC3210FC62EBA61E1B601883EE87F01508C48DC289BB9659912C4325B455102D'
$file = Join-Path $env:TEMP 'dotnet-runtime-11.0.0-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