As part of the task of mass updating Office to the latest version on the computers of all users (according to the scheme), we needed to develop a simple solution for the correct automatic removal of any other versions of Microsoft Office previously installed on computers. It is supposed to use these scripts in tasks for automatic removal / installation of Office through SCCM packages.
In most cases, before installing a new version of Office, it is advisable to remove any versions of MS Office previously installed on the computer (simultaneous use of different versions of Office on the same computer is supported, but not recommended due to potential problems). Therefore, it became necessary to develop scripts that would correctly remove any version of Office previously installed on a PC.
After looking at several ways to remove previously installed versions of Office, we settled on using OffScrub scripts from Microsoft Premier Support. Scripts OffScrub are part of the packages of the official EasyFix packages (the package for forced removal of Office 2007 and 2010, if they cannot be removed in the standard way from the Control Panel) To remove Office 2013 and 2016, another tool is used - the package O15CTRRemove.diagcab, which also includes OffScrub scripts (see footnote just below)
Offscrub scripts are vbs scripts for automating the removal of products from Office. These scripts allow you to completely clean the system of traces of previously installed Office, regardless of its current performance. Here are the main advantages of using Offscrub to uninstall Office:
The script from the O15CTRRemove.diagcab package allows you to determine the installed version of Office and call the Offscrub*.vbs script for the corresponding version of Office.
First of all, you need to download the file from the Microsoft website FixIt for the versions of Office and Windows that are used in your infrastructure.
You can download the O15CTRRemove.diagcab package for different versions of Office and Windows from (https://support.microsoft.com/en-us/kb/971179).
Important note. Previously, this page contained links to both the EasyFix package and O15CTRRemove.diagcab. At the moment, there is only a link to the universal package O15CTRRemove.diagcab, which can be used to remove Office 2013 / 2016 on Window 7, Windows 8 and Windows 10. In addition, back in the beginning of the year in the archive O15CTRRemove.diagcab there were Offscrub scripts for new versions of Office, now only PowerShell scripts remain in it. These (and other) versions of vbs Offscrub scripts can now only be obtained from the official Office Developer GitHub repository (OfficeDev).
Office version | Windows 7 | Windows 8 | Windows 10 |
Office 2003 | MicrosoftFixit20054.mini.diagcab | Absent | |
Office 2007 | MicrosoftFixit20052.mini.diagcab | Absent | |
Office 2010 | MicrosoftFixit20055.mini.diagcab | ||
Office 2013 | File OffScrub_O15msi.vbs on GitHub | ||
Office 2016 | File OffScrub_O16msi.vbs on GitHub | ||
Office 365/ Click-To-Run | File OffScrubc2r.vbs on GitHub |
Download the specified files and save to the C:\tools\OfficeUninstall directory. *.diagcab files are ordinary archives in CAB format that can be unpacked using the command expand.
So, for convenience, for each version of Office, we will create a separate directory:
set OFFICEREMOVE=C:\tools\OfficeUninstall\
md "%OFFICEREMOVE%\2003"
md "%OFFICEREMOVE%\2007"
md "%OFFICEREMOVE%\2010"
md "%OFFICEREMOVE%\2013"
md "%OFFICEREMOVE%\2016"
md "%OFFICEREMOVE%\O365"
Now, in each directory from the downloaded diagcab archives, we will unpack only vbs files.
expand -i "%OFFICEREMOVE%\MicrosoftFixit20054.mini.diagcab" -f:OffScrub*.vbs "%OFFICEREMOVE%\2003"
expand -i "%OFFICEREMOVE%\MicrosoftFixit20052.mini.diagcab" -f:OffScrub*.vbs "%OFFICEREMOVE%\2007"
expand -i "%OFFICEREMOVE%\MicrosoftFixit20055.mini.diagcab" -f:OffScrub*.vbs "%OFFICEREMOVE%\2010"
And copy the same vbs files for new Office versions downloaded from GitHub.
move /y "%OFFICEREMOVE%\OffScrub_O15msi.vbs" "%OFFICEREMOVE%\2013"
move /y "%OFFICEREMOVE%\OffScrub_O16msi.vbs" "%OFFICEREMOVE%\2016"
move /y "%OFFICEREMOVE%\OffScrubc2r.vbs" "%OFFICEREMOVE%\O365"
Thus, we will have such vbs files:
The list of available arguments for any OffScrub vbs script can be obtained like this:
OffScrub_O16msi.vbs /?
Microsoft Customer Support Service - Office 2016 MSI Removal Utility
OffScrub_O16msi.vbs helps to remove Office 2016 MSI Server and Client products
Usage: OffScrub_O16msi.vbs
In order for the Office uninstall script to work correctly on 64-bit versions of Windows, when you run them with a 32-bit Configuration Manager client, you need to run the appropriate version of cscript.exe. Therefore, on a 64-bit system, to run scripts, you need to run the cscript.exe processor from the C:\Windows\SysWOW64 directory.
This functionality can be achieved with a script. NativeCScript.cmd:
@echo off
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
"%SystemRoot%\Sysnative\cscript.exe" %*
) else (
"%SystemRoot%\System32\cscript.exe" %*
)
The finished archive with all the necessary files can be downloaded from our website: (1.4 Mb)
The command to manually run the script to cleanly remove Office 2003 components on a computer will look like this:
Cscript.exe "%OFFICEREMOVE%\2003\OffScrub03.vbs" ALL /Quiet /NoCancel /Force /OSE
If the uninstall job is run as an SCCM package, the uninstall command might look like this:
"%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2003\OffScrub03.vbs" ALL /Quiet /NoCancel /Force /OSE"
Command to cleanly remove Office 2007 components for manual launch:
Cscript.exe "%OFFICEREMOVE%\2007\OffScrub07.vbs" ALL /Quiet /NoCancel /Force /OSE
"%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2007\OffScrub07.vbs" ALL /Quiet /NoCancel /Force /OSE"
Command to cleanly uninstall Microsoft Office 2010 for manual launch:
Cscript.exe "%OFFICEREMOVE%\2010\OffScrub10.vbs" ALL /Quiet /NoCancel /Force /OSE
When launched through Configuration Manager:
"%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2010\OffScrub10.vbs" ALL /Quiet /NoCancel /Force /OSE"
The command to completely remove Microsoft Office 2013 components for manual launch:
Cscript.exe "%OFFICEREMOVE%\2013\OffScrub_O15msi.vbs" ALL /Quiet /NoCancel /Force /OSE
To run a script through an SCCM job:
"%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2013\OffScrub_O15msi.vbs" ALL /Quiet /NoCancel /Force /OSE"
The command to manually run the script to completely remove Office 2016 components on the current one will look like this:
Cscript.exe "%OFFICEREMOVE%\2016\OffScrub_O16msi.vbs" ALL /Quiet /NoCancel /Force /OSE
You can start uninstalling Office 2016 from the SCCM package with the following command:
"%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2016\OffScrub_O16msi.vbs" ALL /Quiet /NoCancel /Force /OSE"
Command to completely remove Office Click to Run / Office 365 components for manual launch:
Cscript.exe "%OFFICEREMOVE%\C2R\OffScrubc2r.vbs" ALL /Quiet /NoCancel /Force /OSE
To run a script through an SCCM job:
"%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "C2R\OffScrubc2r.vbs" ALL /Quiet /NoCancel /OSE"
The Remove-PreviousOfficeInstalls Git project also includes a script Remove-PreviousOfficeInstalls.ps1, which should automatically detect the version of MS Office installed on the computer and call one of the OffScrub-advising scripts. With certain modifications, it can also be used in Office uninstall scripts.
In the top ten, regardless of the edition, the developer embeds the Office 365 application suite, which is intended to become a replacement for the familiar Microsoft Office. However, this package is subscription-based, quite expensive, and uses cloud technologies, which many users do not like - they would prefer to remove this package and install a more familiar one. Our article today is designed to help you do just that.
The task can be solved in several ways - using a special utility from Microsoft or using the system uninstall tool. We do not recommend using uninstall software: Office 365 is tightly integrated into the system, and its removal by a third-party tool may disrupt its operation, and secondly, a third-party application will still not be able to remove it completely.
The easiest way to solve the problem is to use a tool "Programs and Features". The algorithm is the following:
This method is the simplest of all, and at the same time the most unreliable, because often the Office 365 package is not displayed in the specified snap-in, and an alternative tool must be used to remove it.
Users often complained about the inability to remove this package, so the developers recently released a special utility with which you can uninstall Office 365.
- it's automatic.
If after this action, some folders related to this software package are found on the computer, you should use another method.
Remember that manual uninstallation is a long and complicated process, so read the manual carefully!
The first step is to determine the installation type. To do this, launch any Office application and click on "File / Account". If the installation used Click-to-Run technology, you will see the update options. In the case of installation using an MSI package, updates can only be installed through the Windows Center.
Removing the "Click to Run" package:
Completing tasks using the manager: open the "Processes" section and if you see that the tasks indicated in the figure below are in the list, they should be completed.
If Office was installed via MSI, then uninstallation occurs using standard Windows system uninstallation tools.
IMPORTANT! After removing the software with this utility, you should run CCleaner and clean Windows 10 from old files.
In order to uninstall an office program from a Windows 10 system, it is worth doing a number of simple steps:
schtasks.exe /delete /tn "\Microsoft\Office\Office Automatic Updates"
schtasks.exe /delete /tn "\Microsoft\Office\Office Subscription Maintenance"
schtasks.exe /delete /tn "\Microsoft\Office\Office ClickToRun Service Monitor"
schtasks.exe /delete /tn "\Microsoft\Office\OfficeTelemetryAgentLogOn2016"
schtasks.exe /delete /tn "\Microsoft\Office\OfficeTelemetryAgentFallBack2016"
IMPORTANT! The method for Microsoft Office 2016 is described here. If you are using the 2010 version, then in the paths where 2016 is indicated, we indicate 2010.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppVISV
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Office - en-us
HKEY_CURRENT_USER\Software\Microsoft\Office
IMPORTANT! After removing the office software package, you need to restart the computer and start cleaning the system using any cleaner.
For information on how to remove the office suite from Windows 10, see the video: