The simplest way to uninstall any and all ArcGIS products?
I do it with a batch file. You could write the code below as a single line, or by updating locations you could create a loop of paths/installers.
SET INSTALL_PATH=\\myNetworkShare\InstallerLocation\
MSIEXEC.EXE /X %INSTALL_PATH%\setup.msi /QB
The following KB articles provide a good starting place:
Install/Uninstall using Batch files
Silent Uninstall
Edit: just to clarify, using the 2nd article, you can use the GUID, so then you dont need to reference the original installer. I guess one method will make more sense for your script/batch file
This recipe works for us, an extended version of KHibma's answer. There may be better methods but this does well enough for us right now -- grab the Windows registry product codes from HowTo: Silently uninstall ArcGIS products and feed them to msiexec:
msiexec /x %product_code% /qn /passive
Remove the /passive
to run silently (no pop-up progress window).
I've put together uninstall-ALL-ArcGIS-products.bat which removes all ArcGIS products from 8.2 through 10.3.1. (The 10.3+ list is incomplete, but more complete than the above Esri KB article). There's no intelligence to it, no testing to see if something is actually there, it just brute forces it's way through the list. It only works for programs which use the msi installer in the first place, so things like ArcPad are not included.
A more targeted and flexible approach would be to leverage Windows Management Instrumentation Command-line (WMIC).
Uninstall a single named program:
wmic product where ^
"name = 'ArcGIS 10.1 SP1 for Desktop Background Geoprocessing (64-bit)'" ^
call Uninstall
Uninstall anything with ArcGIS in the title, all in one go (note the quirky wildcard syntax):
wmic product where ^
"name like '%ArcGIS%'" ^
call Uninstall
Many more useful examples at WMIC Snippets, such as listing installed programs:
wmic product where "Name like '%ArcGIS%'" ^
get Name, IdentifyingNumber, Version
wmic product where "Vendor like '%Environmental Systems Research Institute%'" ^
get Name, Version, InstallDate, InstallLocation
I elected not to use wmic because the queries take a very long time to return (it's tempting to think it's hung, looking at a blank and unblinking shell prompt for many tens of seconds. It's probably not though).
Python is a bit of separate beast. For example if python was installed with ArcGIS, uninstalling ArcGIS will also uninstall python, but any 3rd party modules added afterwords will be left behind.
Assuming one wants to completely remove Python 2.6 and any associated material (blind copy and paste without understanding not advised):
Remove all Python files for this version on disk:
rd /s/q C:\Python27
Remove registry keys with REG:
reg delete HKLM\SOFTWARE\Python\PythonCore\2.7 /f
reg delete HKCU\SOFTWARE\Python\PythonCore\2.7 /f
If python was not installed in the usual place, you can retrieve it's location with reg query HKLM\SOFTWARE\Python /s
and watch for InstallPath
The last step is remove any Python 2.7 entries from the PATH environment variable, but I've yet to come up with a straightforward (scriptable) way of doing this without installing more tools. That said, Edit the PATH environment variable in Windows without pain is a great resource for said tools.
Also possibly needed is assoc
and ftype
to check and possibly correct the file associations:
Display association:
assoc .py
.py=Python.File
ftype Python.File
Python.File="C:\Python26\python.exe" "%1" %*
Delete association:
assoc .py=
ftype Python.File=
(courtesy of @dash-tom-bang on Stack Overflow, also check for .pyc
, .pyw
)
Be sure you uninstall all 3rd party arcgis extensions before uninstalling ArcGIS. Often 3rd party (un)installers check to make sure the appropriate Esri libraries are present before allowing installation - or uninstallation!
For example, say you have a 3rd party Arcmap extension written for 10.0, and you uninstall ArcGIS 10.0, then install ArcGIS 10.1. When you upgrade to 10.1, the 3rd party extension may or may not work. At any rate, when you try to uninstall the 10.0 version of the extension, the uninstaller will complain that required libraries are missing (the 10.0 libraries in other words.)
The painful solution is: uninstall 10.1, re-install 10.0, uninstall the 3rd party extensions, uninstall 10.0, re-install 10.1.
I've tried other solutions, like ccleaner, but with limited success. If there's a more reliable, and less painful way, I'd certainly like to hear about it.