免互動安裝Python 3.11、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Python.Python.3.11 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Python.Python.3.11 -e --silentwinget uninstall --id Python.Python.3.11 -e --silent依安裝檔
64位元 · EXE(WiX Burn) · 僅目前使用者
靜默安裝
python-3.11.9-amd64.exe /quiet /norestart解除安裝
msiexec /x {1DA2E09B-199C-4DEF-9A99-93A8C1B8DDF2} /qn /norestart- MSI產品代碼
- {1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- UpgradeCode
- {767B31EB-0106-5AE3-B46E-77F32D1BABA2}
- DisplayVersion
- 3.11.9150.0
64位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
python-3.11.9-amd64.exe /quiet /norestart解除安裝
msiexec /x {1DA2E09B-199C-4DEF-9A99-93A8C1B8DDF2} /qn /norestart- MSI產品代碼
- {1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1da2e09b-199c-4def-9a99-93a8c1b8ddf2}
- UpgradeCode
- {767B31EB-0106-5AE3-B46E-77F32D1BABA2}
- DisplayVersion
- 3.11.9150.0
ARM64 · EXE(WiX Burn) · 僅目前使用者
靜默安裝
python-3.11.9-arm64.exe /quiet /norestart解除安裝
msiexec /x {3C1B70E3-48E4-4D2A-B16C-FC68485D2959} /qn /norestart- MSI產品代碼
- {3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- UpgradeCode
- {67E89A38-DE2D-5EC8-8C94-43166EFC6CF3}
- DisplayVersion
- 3.11.9150.0
ARM64 · EXE(WiX Burn) · 所有使用者
靜默安裝
python-3.11.9-arm64.exe /quiet /norestart解除安裝
msiexec /x {3C1B70E3-48E4-4D2A-B16C-FC68485D2959} /qn /norestart- MSI產品代碼
- {3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3c1b70e3-48e4-4d2a-b16c-fc68485d2959}
- UpgradeCode
- {67E89A38-DE2D-5EC8-8C94-43166EFC6CF3}
- DisplayVersion
- 3.11.9150.0
32位元 · EXE(WiX Burn) · 僅目前使用者
靜默安裝
python-3.11.9.exe /quiet /norestart解除安裝
msiexec /x {B047D2A0-FE22-4D51-AE4C-4FC15FB14B31} /qn /norestart- MSI產品代碼
- {b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- UpgradeCode
- {C2007350-35A9-53B8-9AC1-4EB4C04802E2}
- DisplayVersion
- 3.11.9150.0
32位元 · EXE(WiX Burn) · 所有使用者
靜默安裝
python-3.11.9.exe /quiet /norestart解除安裝
msiexec /x {B047D2A0-FE22-4D51-AE4C-4FC15FB14B31} /qn /norestart- MSI產品代碼
- {b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{b047d2a0-fe22-4d51-ae4c-4fc15fb14b31}
- UpgradeCode
- {C2007350-35A9-53B8-9AC1-4EB4C04802E2}
- DisplayVersion
- 3.11.9150.0
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe'
$sha256 = '5EE42C4EEE1E6B4464BB23722F90B45303F79442DF63083F05322F1785F5FDDE'
$file = Join-Path $env:TEMP 'python-3.11.9-amd64.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 /norestart' -Wait install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe'
$sha256 = '5EE42C4EEE1E6B4464BB23722F90B45303F79442DF63083F05322F1785F5FDDE'
$file = Join-Path $env:TEMP 'python-3.11.9-amd64.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 /norestart' -Wait install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-arm64.exe'
$sha256 = '58F3A4E91B63D5A680ECC77C1DB4565A1E3966E8656D4C8B89200D58C1F5C4F3'
$file = Join-Path $env:TEMP 'python-3.11.9-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 /norestart' -Wait install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9-arm64.exe'
$sha256 = '58F3A4E91B63D5A680ECC77C1DB4565A1E3966E8656D4C8B89200D58C1F5C4F3'
$file = Join-Path $env:TEMP 'python-3.11.9-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 /norestart' -Wait install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9.exe'
$sha256 = 'AF19E5E2F03E715A822181F2CB7D4EFEF4EDA13FA4A2DB6DA12E998E46F5CBF9'
$file = Join-Path $env:TEMP 'python-3.11.9.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 /norestart' -Wait install-python-3-11.ps1
$url = 'https://www.python.org/ftp/python/3.11.9/python-3.11.9.exe'
$sha256 = 'AF19E5E2F03E715A822181F2CB7D4EFEF4EDA13FA4A2DB6DA12E998E46F5CBF9'
$file = Join-Path $env:TEMP 'python-3.11.9.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 /norestart' -Wait