Ordres per instal·lar Notepad2 sense preguntes, desinstal·lar-lo i detectar-lo des d’eines de desplegament. Només es mostra una ordre quan és segura: la que indica el manifest o el valor per defecte documentat de la tecnologia de l’instal·lador.
Guia relacionada: Instal·lació silenciosa: MSI, NSIS, Inno Setup · Desinstal·lar un programa amb el registre o PowerShell
Amb winget
PowerShell
winget install --id flos-freeware.Notepad2 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id flos-freeware.Notepad2 -e --silentwinget uninstall --id flos-freeware.Notepad2 -e --silentPer instal·lador
64 bits · EXE · Tots els usuaris
Instal·lació silenciosa
Notepad2_4.2.25_x64.exe /SILENT32 bits · EXE · Tots els usuaris
Instal·lació silenciosa
Notepad2_4.2.25_x86.exe /SILENTPowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
install-notepad2.ps1
$url = 'https://www.flos-freeware.ch/zip/Notepad2_4.2.25_x64.exe'
$sha256 = '2C947CADE89BC53F0FD5B76C74ECA4A730F53CC0E1E3AF444B2701E066D4CA93'
$file = Join-Path $env:TEMP 'Notepad2_4.2.25_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 '/SILENT' -Wait install-notepad2.ps1
$url = 'https://www.flos-freeware.ch/zip/Notepad2_4.2.25_x86.exe'
$sha256 = 'D76C09DA09DF25017D76F05B1CAE90B76406A34EB081A092EA16E00B9D5AEF20'
$file = Join-Path $env:TEMP 'Notepad2_4.2.25_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 '/SILENT' -Wait