免互動安裝OneCommander、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id MilosParipovic.OneCommander -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id MilosParipovic.OneCommander -e --silentwinget uninstall --id MilosParipovic.OneCommander -e --silent依安裝檔
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i OneCommanderSetup3.108.0.0.msi /qn /norestart寫入記錄檔
msiexec /i OneCommanderSetup3.108.0.0.msi /qn /norestart /l*v "%TEMP%\onecommander-install.log"解除安裝
msiexec /x {EB4460E4-348E-490A-A2F6-6DFFD2C47C7B} /qn /norestart- MSI產品代碼
- {EB4460E4-348E-490A-A2F6-6DFFD2C47C7B}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EB4460E4-348E-490A-A2F6-6DFFD2C47C7B}
- UpgradeCode
- {E2AFC434-3689-40B9-B3DB-A1D80FDDA478}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-onecommander.ps1
$url = 'https://onecommander.com/OneCommanderSetup3.108.0.0.msi'
$sha256 = 'FDC57E58231C166E22176F3421F05C5336FC377CCFA21AA1C96A121439B62E0D'
$file = Join-Path $env:TEMP 'OneCommanderSetup3.108.0.0.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait