Error code 1639 with message “Invalid command line argument” indicates that SQL Server setup is being started with at least one unsupported or malformed parameter.
For SQL Server 2022 Express, the Database Engine component accepts a defined set of command-line parameters such as:
-
/INSTANCENAME(required for normal installs, optional for SysPrep) -
/INSTANCEID(optional) -
/PID(optional; predefined for Express) -
/PRODUCTCOVEREDBYSA(required only when installing the Azure Extension feature withAZUREEXTENSION) -
/Qor/QUIET//QSor/QUIETSIMPLE(UI behavior) - Directory parameters like
/INSTALLSHAREDDIR,/INSTALLSHAREDWOWDIR,/INSTANCEDIR
Any parameter outside what setup expects for the chosen scenario, or a valid parameter with an invalid value or syntax, will cause MSI error 1639 and the “Invalid command line argument” message.
Since the installation is being launched as a prerequisite from another program, that program is most likely constructing and calling setup.exe with an incorrect or outdated parameter set (for example, using parameters that changed between SQL versions, or passing /PRODUCTCOVEREDBYSA incorrectly, or omitting a required /INSTANCENAME in a non-default scenario).
To resolve:
- Open the detailed component log referenced in the summary:
-
C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\Log\20260421_145857\sql_engine_core_inst_Cpu64_1.log - Search for the full
msiexecorsetup.execommand line; it will show the exact parameters being passed.
-
- Compare those parameters against the supported installation parameters for SQL Server 2022 setup from the command prompt and remove or correct any invalid ones (wrong names, typos, unsupported values, or parameters that only apply to other scenarios like failover clusters or Azure Extension).
- If the prerequisite installer is hard-coded and cannot be edited, bypass it by:
- Installing SQL Server 2022 Express manually with a valid command line (or via the standard setup UI) using only supported parameters.
- Then rerun the main program installer so it detects the already-installed SQL instance.
If the failure persists after cleaning up and reinstalling, focus on correcting the command line rather than further registry/file cleanup, since error 1639 is specifically about invalid setup arguments, not leftover components.
References: