免互動安裝Spotify、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Spotify.Spotify -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Spotify.Spotify -e --silentwinget uninstall --id Spotify.Spotify -e --silent依安裝檔
64位元 · EXE · 僅目前使用者
靜默安裝
SpotifyFullSetupX64.exe /silent /skip-app-launch- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spotify
ARM64 · EXE · 僅目前使用者
靜默安裝
SpotifyFullSetupARM64.exe /silent /skip-app-launch- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Spotify
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-spotify.ps1
$url = 'https://download.scdn.co/SpotifyFullSetupX64.exe'
$sha256 = 'E5CA46AD79DE202C8DEAF888C26F2A608B9E042142279E0690D589D80640591D'
$file = Join-Path $env:TEMP 'SpotifyFullSetupX64.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 '/silent /skip-app-launch' -Wait install-spotify.ps1
$url = 'https://download.scdn.co/SpotifyFullSetupARM64.exe'
$sha256 = '1AB0FF830A6996E69F8DB9CC5B7FB08BD6E87FC16E70642F8C5DFBE711EE948D'
$file = Join-Path $env:TEMP 'SpotifyFullSetupARM64.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 '/silent /skip-app-launch' -Wait