How to silently uninstall Python 2.7 on Windows?
Asked Answered
H

1

8

Does anyone know how to silently uninstall Python 2.7 - i.e. uninstall it unattended, with no need for user interaction? I need to do it as part of an uninstallation script that installs a bunch of software silently.

I've tried running msiexec with the /x and /qn flags on the msi file that was originally installed, but it fails - it just throws up the general help message, implying that I'm using invalid options.

I've done a Google search, and can find help for earlier versions - they can be uninstalled silently by running the unwise.exe that's installed with them, with the right options. But 2.7 doesn't seem to include an unwise.exe, so I can't do that.

Does anyone know how to do this?

Edit: The answer turned out to be embarrassingly simple. Those were the correct command-line options all along - it's just that the order matters. The correct command was:

msiexec /x python-2.7.3.amd64.msi /qn

The important thing was to have the /qn option after the msi file.

Hostelry answered 13/3, 2013 at 20:17 Comment(0)
E
5

Edit: Ignore what I previously said, here's the solution according to the Python 2.4 Documentation:

It is not necessary to have the MSI file available for uninstallation; alternatively, the package or product code can also be specified. You can find the product code by looking at the properties of the Uninstall shortcut that Python installs in the start menu.

Hit the Windows Key, search Python Uninstall, right click it and go to Properties. The Product Key is in the Target field, you can use that to uninstall by doing:

msiexec /x {03mY-L0NG-A77-K3Y}.msi /qn
Earp answered 13/3, 2013 at 20:30 Comment(4)
I just confirmed, this successfully uninstalled my version of Python 2.7.3.Earp
Thanks! The solution turned out to be even simpler than that; I was using the command-line options in the wrong order. Thanks very much for taking the time to help!Hostelry
Ah gotcha, great! Glad I could help, no problem.Earp
I tried this to quietly uninstall the python 2.7.9 64bit from my pc(windows 7) but it didn't uninstall & remove the python files at all. Also it shows a long product key/code in "Properties" >> "Target" area, like "{79F081BF-7454-43DB-BD8F-9EE596813233}". Please advise.Through

© 2022 - 2024 — McMap. All rights reserved.