Skip to content

Silent install for a Setup.exe: the /S switch, custom folders and deployment

How to run an NSIS-based Setup.exe silently with /S, choose the folder with /D=, uninstall silently, and roll the installer out with Intune, PDQ or a script.

Updated October 31, 2026 · 2 min read

IT teams don't click through wizards. They run the installer from a script or a deployment tool and expect it to finish on its own. Every installer ExeTup builds is an NSIS installer, and NSIS has supported silent installs for decades. This guide covers the switches, the pitfalls, and how the usual deployment tools call them.

The switches

Setup.exe /S

Installs with the defaults you set when building: the default folder, the shortcuts, the chosen scope. No windows appear. The switch is case-sensitive: /S, not /s.

Setup.exe /S /D=C:\Apps\My App

Installs to a different folder. Rules for /D=:

  • it must be the last parameter on the command line;
  • the path has no quotes, even when it contains spaces;
  • it is case-sensitive too.

Silent uninstall:

"C:\Program Files\My App\unins000.exe" /S

The uninstaller is named unins000.exe in the install folder, and it registers under Settings → Apps, so winget uninstall and most deployment tools find it as well.

What a silent install still does

  • Installs for all users (into Program Files, needing elevation) or per user, as chosen at build time. A per-machine installer run silently from a non-elevated prompt fails quietly; run it from an elevated shell or your deployment tool's system context.
  • Creates the Start Menu and Desktop shortcuts if they were enabled.
  • Registers the uninstaller and the version in Windows Settings.
  • Does not launch the app afterwards, even if "launch after install" is on. That page is skipped in silent mode.
  • Uses the first language when several are configured; the language dialog is skipped.

Exit codes

A successful silent install exits with 0. A non-zero code means it was aborted, most often because elevation was refused or the installer was already running. Scripts should check the code:

Setup.exe /S
if %errorlevel% neq 0 exit /b %errorlevel%

In PowerShell, use Start-Process -Wait -PassThru and read .ExitCode, because Setup.exe returns immediately otherwise:

$p = Start-Process -FilePath ".\Setup.exe" -ArgumentList "/S" -Wait -PassThru
exit $p.ExitCode

Deployment tools

  • Microsoft Intune: package as a Win32 app (.intunewin) with install command Setup.exe /S and uninstall command "%ProgramFiles%\My App\unins000.exe" /S. Use the registry entry under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\My App or the main .exe as the detection rule.
  • PDQ Deploy, ManageEngine, Chocolatey: an "Install" step running Setup.exe /S in the system context.
  • Group Policy: GPO software installation wants MSI files. Use a start-up script that runs Setup.exe /S instead.
  • winget: a manifest with InstallerType: nullsoft tells winget the switches; the installer must be hosted at a stable URL.

Upgrades

Running a newer Setup.exe /S over an installed version replaces the files in place and updates the version in Windows Settings. Users should close the app first; a running .exe can't be overwritten.

FAQ

Is the switch /S or /silent?

/S, uppercase. NSIS installers ignore /silent and /verysilent, which belong to Inno Setup.

Can I pass the folder with spaces?

Yes, without quotes: Setup.exe /S /D=C:\Program Files\My App. The /D= parameter has to be the last thing on the line.

Does silent install need admin rights?

Only for installers built for all users. Per-user installers run silently without elevation, which is useful on managed laptops where users aren't administrators.

Where is the uninstaller?

unins000.exe in the install folder. It takes the same /S switch for a silent uninstall.

Related guides