When automating the removal of Office 2007, we need to call setup.exe to perform the work. Because Office 2007 is a multi-msi based product we cannot use msiexec for the installation, nor the uninstallation of Office 2007.
To run Setup.exe to remove a specified Office product from the user’s computer, use the /uninstall command-line option, which uses the following syntax:
[ProductID] is the value for the product that you want to modify. Look up the value of [ProductID] in the Setup.xml file for the product.
The following example shows how to use the /uninstall command to remove an Office Professional Plus 2007 installation. Office12 is the root of the network installation point for ProPlus:
\\server\share\Office12\setup.exe /uninstall ProPlus
In enterprise deployments, we recommend that you run a silent uninstall. To run a silent uninstallation of a Office 2007 product that requires no user interaction, you must modify the Config.xml file for the product that you want to uninstall and set the Display element's Level attribute to "none" (Display Level="none"), and then save the Config.xml file as UninstallConfig.xml. You may also want to prevent the reboot of the machine after the uninstallation. We can also set this in a custom Config.xml.
<Configuration Product="ProPlus"><Display Level="none" CompletionNotice="no" /> <Setting Id="SETUP_REBOOT" Value="NEVER" /></Configuration>
<Display Level="none" CompletionNotice="no" /> <Setting Id="SETUP_REBOOT" Value="NEVER" />
To then uninstall Microsoft Office Professional Plus 2007 after you modify the Config.xml to set silent options, use the following command where \\server\share\Office12 is the path of the Office 2007 Professional Plus source files, and <pathtoUninstallConfig.xml> is the location of your modified Config.xml file for Office Professional Plus:
\\server\share\Office12\setup.exe /uninstall ProPlus /config <pathtoUninstallconfig.xml>\UninstallConfig.xml