Site icon EfmSoft

What does Windows error code 1639 (ERROR_INVALID_COMMAND_LINE) mean?

 
Previous Next
ERROR_PRODUCT_VERSION ERROR_INSTALL_REMOTE_DISALLOWED

ERROR_INVALID_COMMAND_LINE

The Windows Installer command line is invalid.

ERROR_INVALID_COMMAND_LINE is Win32 error 1639 (0x667). The installer could not interpret one or more options, package arguments, properties, or quoting rules. This is a caller-side syntax failure, not proof that the MSI package is corrupt. Bootstrapper layers often construct the final command dynamically, so the command seen by the user may differ from the one received by msiexec.exe.

Common syntax problems

What to log safely

Record the executable actually launched, tokenized argument array before process creation, final command line with passwords and secrets redacted, working directory, caller shell, bootstrapper version, and msiexec exit code. Preserve whether a package path or ProductCode was intended. Logging only one concatenated string can hide where quoting changed argument boundaries.

How to find the bad argument

Compare the invocation with the documented standard and legacy Windows Installer options. Reproduce by launching msiexec directly from a controlled command prompt using the same package. Add options incrementally, keeping verbose logging, until the invalid combination is isolated.

For programmatic launchers, pass a correctly quoted argument list and test spaces, trailing backslashes, embedded quotes, Unicode paths, and empty property values. Distinguish shell parsing from Windows Installer parsing. A command that works in PowerShell may need different escaping when passed through cmd.exe or a service wrapper.

Correction

Fix the invocation rather than editing the MSI. Use one explicit operation mode, absolute paths, supported restart options, and a writable log destination. Deployment systems should store structured arguments and render them for the target process only once. Do not echo sensitive property values to troubleshooting output.

Difference from package-open failures

ERROR_INSTALL_PACKAGE_OPEN_FAILED means Windows Installer accepted the command but could not open the package. Error 1639 means parsing or validating the command itself failed, often before the package is accessed.

Example

A deployment wrapper builds /i C:\Packages\My App.msi /qn without quotes. Msiexec treats the path as multiple arguments and returns 1639. Passing the package path as one correctly quoted argument resolves the failure; replacing the MSI file does not.

References


Looking for a different code? Search another status or error code.

Exit mobile version