免互動安裝WD Security、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id WesternDigital.Security -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id WesternDigital.Security -e --silentwinget uninstall --id WesternDigital.Security -e --silent依安裝檔
64位元 · ZIP · 所有使用者
靜默安裝
WDSecurity_WIN.zip /quiet /norestart解除安裝
msiexec /x {3E97586C-E4A7-4568-B269-8CFF86F29336} /qn /norestart- MSI產品代碼
- {3e97586c-e4a7-4568-b269-8cff86f29336}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3e97586c-e4a7-4568-b269-8cff86f29336}
- UpgradeCode
- {4C1DC8BC-4578-4181-86DE-1EA8E20E3EB5}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-wd-security.ps1
$url = 'https://downloads.wdc.com/wdapp/WDSecurity_WIN.zip'
$sha256 = 'F32EE30DFB1E7F398B971F9F0091835EE18E9FBA12590A1773A09102B7A5BF00'
$file = Join-Path $env:TEMP 'WDSecurity_WIN.zip'
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