Office 2010 / 2013 silent uninstall, directory based

Yet another masterpiece. I love directory based scripts so much. This only means less code and more productivity. Now I uninstall Office 2010 and Office 2013 systems with very shortcode. Same code for booth system. That is because the script looks for Office installation source into subdirectories. If it founds Office 2010 source then it compares the directory name with installed programs from the registry. If the Office program was found then uninstall it. Same scenario for Office 2013.

The directory structure for this sample is:
\uninstall-office-2010-2013.cmd
\x64\Office14.PROPLUS\setup.exe
\x64\Office14.PROPLUS\setup.xml
\x64\Office15.PROPLUS\setup.exe
\x64\Office15.PROPLUS\setup.xml
\x86\Office14.PROPLUS\setup.exe
\x86\Office14.PROPLUS\setup.xml
\x86\Office15.PROPLUS\setup.exe
\x86\Office15.PROPLUS\setup.xml
The directory names like Office14.PROPLUS and Office15.PROPLUS is just registry key name under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall or
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
That is why I call this method "directory based" :)

Save:
I set this script in computer startup and then sleep.exe is crucial:

No comments: