I get Error 1639 while trying to install SQL Server Express on my machine: "Invalid command line argument. Consult the Windows Installer SDK for detailed command line help. I am using a local account with Windows authentication. I had SQL Server installed previously but I deleted all previous instances from my machine (Services, Apps, Registry Keys, etc.) Any solutions?
A Windows Installer 1639 usually means SQL Setup is being launched with an argument Windows Installer does not like. The next step is to look at the detailed log, not just the summary.
Open the log folder shown at the bottom of the setup window. In addition to Summary_*.txt there should be a Detail.txt (and sometimes other component logs). In those files, search for "Return value 3" and also search for "Command line" or "Arguments". That should show the exact parameter string that triggered the 1639.
Next, try rerunning setup with the smallest selection possible. Choose only "Database Engine Services" and uncheck Full-Text, Replication, and any AI features. If the engine-only install succeeds, we can add features later.
If it still fails, do a deeper cleanup: uninstall all SQL-related items from Apps and Features (SQL Server, Setup Support, Browser, VSS Writer, LocalDB, ODBC drivers, shared components), reboot, then reinstall using a freshly downloaded installer saved to a simple local folder like C:\SQLSetup. Run setup as Administrator.
Also make sure Windows is fully rebooted (no pending restart from updates), and if you have aggressive antivirus, temporarily disable it during the install.
If all else fails, throw that computer out the window and just get a new one. LOL
Alex LewisOP
@Reply 4 months ago
These are the errors as they are displayed during installation.
I did a quick Google search on these errors, and it says the needed files don't exist(?). You'd think it would automatically install the needed files.
Alex LewisOP
@Reply 4 months ago
Alex LewisOP
@Reply 4 months ago
Alex LewisOP
@Reply 4 months ago
Alex LewisOP
@Reply 4 months ago
Richard My Access DB is on this machine. I don't want to lose ALL my work. LOL
Copy those files somewhere safe (desktop, external drive, etc.) before doing anything else.
The errors you're seeing (WMI failure, null path, perf counter removal) usually mean the previous SQL install did not uninstall cleanly and left behind broken components. That can cause Setup to fail even on a fresh install attempt.
After backing up your database files, uninstall all SQL Server components from Apps & Features, reboot, then reinstall using a freshly downloaded installer and run setup as Administrator.
Once SQL Server is installed again, you can reattach your MDF files in SQL Server Management Studio and your databases will come right back.
Alex LewisOP
@Reply 4 months ago
Did a little bit more digging and realized I had leftover components of an old SQL Server download (SQL 2022) in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall section of the Registry Editor. I (carefully and after backing up Windows, of course) deleted all subkeys where the DisplayName included "SQL Server." Reinstalling the SQL Server engine right now (running as an administrator account) and will update with results.
Fingers crossed. I'd definitely backup your MDF files too!
Alex LewisOP
@Reply 4 months ago
UPDATE:
Richard After following your instructions and doing a few more advanced tricks to get it to work (including msiexec for remnants of old SQL Server files), I finally got it working! I really appreciate all your help!
LLAP
Pete Santiago
@Reply 3 months ago
Good morning. I'm a little behind on the course as I've been learning other things for my work (Google Scripts, Ubuntu Server, etc.) This is in response to Alex Lewis, and I'm not promoting this as this is just a tool that I use to clean up unnecessary software on the desktops I managed. The program is called Revo Uninstaller, and yes, it is free. This shows all your windows programs & software installed. How this works: Click a program to uninstall, Click on Uninstall at top, it runs through the programs built in Uninstaller first. When it finishes uninstalling, you have the option to click scan which will search for files, folders, and the registry that has to deal with that program for you to select those files and delete them. I always back up before do this, but I have not had any issues using this within my work or home environment. Just my two cents to help! Also, thank you Richard for all that you do.
Alex LewisOP
@Reply 3 months ago
Pete I may have to check that out. My SQL Server setup is working fine now, but I appreciate the input!
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Installing SQL Server.