Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Microsoft Office / How to Uninstall Any Previous Microsoft Office Version with Removal Scripts

January 26, 2026

How to Uninstall Any Previous Microsoft Office Version with Removal Scripts

Before installing a new version of Microsoft Office on a computer, it is recommended to remove any existing versions of Office. While multiple versions of Office can coexist on the same system, this configuration is not recommended due to the potential for conflicts, especially regarding license activation. In this article, we’ll look at several tools and scripts for automatically removing any previous versions of Microsoft Office from a computer and cleaning up any residual components. These scripts can be used to silently uninstall Office from users’ computers via SCCM, Intune, GPO, or other deployment tools.

Contents:
  • Uninstall Any Microsoft Office Version Using the SARAcmd Tool
  • Remove Existing MSI-based Office Versions using ODT
  • OffScrub: Scripts to Completely Remove All Office Installations
  • Removing Pre-Installed Microsoft.Office.Desktop App

Uninstall Any Microsoft Office Version Using the SARAcmd Tool

The Microsoft Support and Recovery Assistant (SaRA) is a diagnostic toolkit for resolving common Microsoft Office issues (including Microsoft 365, Outlook, Teams, etc.). It includes the SaRACmd console tool for completely removing one or all previously installed Office versions.

The SaRa graphical utility is no longer supported as a standalone program. It has been integrated into Microsoft’s Get Help app.

Now, let’s see how to use SaRACmd to uninstall any version of Microsoft Office from a Windows device:

The SaRA console command supports all Windows platforms and enables removal of the following Microsoft Office versions: Microsoft 365, Office 2021, 2019, 2016, 2013, 2010, and 2007. Both MSI and Click-to-Run (C2R) Microsoft Office versions are supported for removal.
  1. Visit the Microsoft Enterprise version of the Microsoft Support and Recovery Assistant download page to get the latest version of the SaRA package (currently, it is SaRACmd_17_01_3954_000.zip, dated 12/9/2025).
  2. Extract the archive to a local folder.
  3. Open a command prompt as an administrator and change to the SaRACmd directory: CD C:\Tools\SaRACmd
  4. To uninstall all previous versions of Office from the computer, run the following command:
    SaRAcmd.exe -S OfficeScrubScenario -AcceptEula -OfficeVersion All
SaRa writes logs by default to the %localappdata%\SaRALogs folder. You can change the log folder using the -LogFolder <Output Path> option.

With the SaRA, you can uninstall only a specific version of Office by specifying it as an argument of the Officeversion parameter. Valid values are All, M365, 2021, 2019, 2016, 2013, 2010, and 2007.

For example:

  • Uninstall Office 2019 only: SaRAcmd.exe -S OfficeScrubScenario -AcceptEula -Officeversion 2019
  • Uninstall Microsoft 365 Apps (ex-Office 365): SaRAcmd.exe -S OfficeScrubScenario -AcceptEula -OfficeVersion M365

The SaRAcmd tool returns an error code when completed. For example, if the removal is successful, the tool will return a code of 0.

00: Successfully completed this scenario. We recommend you restart the computer to finish any remaining cleanup tasks.
Scenario finished with exit code: [0].

SaRAcmd run OfficeScrubScenario cmd

For example, SaRAcmd returned the following error on my computer:

06: Office programs are running. Please close all open Office programs and then re-run this scenario. 
Scenario finished with exit code: [6].

In my case, the removal was prevented because the MS Teams client was set to start automatically. Therefore, you need to close all running Office processes before running the uninstall command. You can kill the MS Office app processes by using the PowerShell Stop-Process command.

Stop-Process -Name winword.exe -Confirm
Stop-Process -Name excel.exe -Confirm

Etc.

The following Office processes must be terminated: lync, winword, excel, msaccess, mstore, infopath, setlang, msouc, ois, onenote, outlook, powerpnt, mspub, groove, visio, winproj, graph, teams.

Note that SaRAcmd utilizes the OffScrubC2R.vbs script under the hood to remove Office Click-to-Run (C2R) products. This can be seen in the Task Manager by the cscript.exe process, which executes the OffScrubC2R.vbs file from the %UserProfile%\AppData\Local\Temp folder. Therefore, in order to use SaRA, the VBScript feature in Windows must not be disabled.

Refer to the next section for details on using OffScrub scripts for Office removal.

offscrubc2r vbs script

The SaRAcmd tool can be used to uninstall Office from remote computers via PowerShell Remoting (Enter-PSSession or Invoke-Command cmdlets).

Remove Existing MSI-based Office Versions using ODT

If you use the Microsoft Office Deployment Tool (ODT) to deploy C2R versions of Office 2024, 2021, or Microsoft 365 Apps on computers, any previous MSI-based Office installations can be removed during the deployment process. To do this, add the RemoveMSI parameter to the XML config file.

We previously demonstrated how to deploy a custom MS Office app in an enterprise environment using ODT.

Example of an ODT configuration file:

<Configuration>
  <Add OfficeClientEdition="64" Channel="Current" >
  <Product ID="O365ProPlusRetail">
    <Language ID="en-us" />
  </Product>
  </Add>
  <RemoveMSI />
</Configuration>

Use the RemoveMSI parameter to uninstall all previous versions of MS Office (2010, 2013, 2016, and 2019), as well as the Project and Visio apps that were installed using the Windows Installer (MSI).

To uninstall modern Click-to-Run (C2R) versions of Office using ODT, add the Remove directive to the XML file. For example, use this configuration to uninstall Office 2021 LTSC and the Microsoft 365 app:

<Remove All="FALSE">
  <Product ID="Office2021Enterprise">
  <Language ID="en-us" />
  </Product>
  <Product ID="O365ProPlusRetail" />
</Remove>

OffScrub: Scripts to Completely Remove All Office Installations

OffScrub (Office Scrubber) is a set of VBS scripts for automating the removal of previously installed Microsoft Office versions from Windows. OffScrub scripts are known for their ability to correctly remove old Office versions, regardless of their current operability/health. The script can detect and clean all residual components of an existing installed Office version.

Here are the main advantages of using Offscrub to remove Office:

  • It supports the uninstallation of all versions of Office, including Click-to-Run (C2R), MSI, and pre-installed Microsoft Office apps in UWP format (Microsoft Store).
  • It enables the removal of an older version, even when the original installation files or Office cache are missing or damaged.
  • User keys in the registry are not affected.
  • Provides complete Office removal, including cases when a regular uninstall is no longer possible.
  • Removes legacy settings and all Office products (including Project, Visio, and Visio Viewer).
OffScrub scripts were previously widely used by Microsoft Premier Support engineers (PFEs). Offscrub scripts are no longer developed and have been deprecated. However, you can still use them in your Office removal tasks.

For some reason, the official Office-IT-Pro-Deployment-Scripts GitHub repository, which contained OffScrub scripts and other tools, was deleted in early 2026. However, you can still download OffScrub files via the web archive. https://web.archive.org/web/20251210133824/https://github.com/OfficeDev/Office-IT-Pro-Deployment-Scripts/tree/master/Office-ProPlus-Deployment/Remove-PreviousOfficeInstalls

All required OffScrub script files are bundled in a ready-to-deploy archive available for download from our website: OfficeRemova-OffScrubl.zip (1.4 MB)

remove previous office installs with vbs and powershell scripts

How can OffScrub scripts be used to uninstall a previous MS Office installation?

I created a separate directory for each version of Office:

set OFFICEREMOVE=C:\tools\OfficeUninstall\
md "%OFFICEREMOVE%\2003"
md "%OFFICEREMOVE%\2007"
md "%OFFICEREMOVE%\2010"
md "%OFFICEREMOVE%\2013"
md "%OFFICEREMOVE%\2016"
md "%OFFICEREMOVE%\O365"

Download and save each VBS file from GitHub to its directory. The following directory structure can be used:

  • 2003\OffScrub03.vbs
  • 2007\OffScrub07.vbs
  • 2010\OffScrub10.vbs
  • 2013\OffScrub_O15msi.vbs
  • 2016\OffScrub_O16msi.vbs
  • O365\OffScrubc2r.vbs

You can get the list of available arguments for any OffScrub VBS script as follows:

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 [List of config ProductIDs] [Options]

OffScrub_O16msi.vbs

To ensure that the Office removal script executes correctly on Windows x64 systems when launched by the 32-bit Configuration Manager (SCCM) client, invoke the appropriate cscript.exe version. So, to run the OffScrub VBS on a 64-bit computer, you need to run cscript.exe from C:\Windows\SysWOW64.

You can achieve this using the NativeCScript.cmd script:

@echo off
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
"%SystemRoot%\Sysnative\cscript.exe" %*
) else (
"%SystemRoot%\System32\cscript.exe" %*
)

Below are CLI commands to completely uninstall different versions of Microsoft Office:

Product VersionCommand
Office 2003Cscript.exe "%OFFICEREMOVE%\2003\OffScrub03.vbs” ALL /Quiet /NoCancel /Force /OSE
Command to uninstall Office via SCCM package: "%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2003\OffScrub03.vbs" ALL /Quiet /NoCancel /Force /OSE"
Office 2007Cscript.exe "%OFFICEREMOVE%\2007\OffScrub07.vbs” ALL /Quiet /NoCancel /Force /OSE
SCCM: "%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2007\OffScrub07.vbs" ALL /Quiet /NoCancel /Force /OSE"
Office 2010 MSICscript.exe "%OFFICEREMOVE%\2010\OffScrub10.vbs” ALL /Quiet /NoCancel /Force /OSE
SCCM: "%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2010\OffScrub10.vbs" ALL /Quiet /NoCancel /Force /OSE"
Office 2013 MSICscript.exe "%OFFICEREMOVE%\2013\OffScrub_O15msi.vbs” ALL /Quiet /NoCancel /Force /OSE
SCCM: "%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2013\OffScrub_O15msi.vbs" ALL /Quiet /NoCancel /Force /OSE"
Office 2016 MSICscript.exe "%OFFICEREMOVE%\2016\OffScrub_O16msi.vbs” ALL /Quiet /NoCancel /Force /OSE
SCCM: "%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "2016\OffScrub_O16msi.vbs" ALL /Quiet /NoCancel /Force /OSE"
C2R Office versions (Microsoft 365, Office LTSC 2024, 2021, 2019, 2016, and 2013)Cscript.exe "%OFFICEREMOVE%\C2R\OffScrubc2r.vbs” ALL /Quiet /NoCancel /Force /OSE
SCCM: "%SystemRoot%\System32\cmd.exe" /C "NativeCScript.cmd //B //NoLogo "C2R\OffScrubc2r.vbs" ALL /Quiet /NoCancel /OSE"

removing previous ms office using offscrub vbs script

The Remove-PreviousOfficeInstalls GitHub project includes the Remove-PreviousOfficeInstalls.ps1 PowerShell script, which automatically detects installed Office versions and invokes the appropriate Offscrub.vbs removal script.

Removing Pre-Installed Microsoft.Office.Desktop App

Note that Windows 10 and Windows 11 often ship with Microsoft.Office.Desktop.Apps preinstalled. You can remove this Microsoft Store version of Office using PowerShell.

Get-AppxProvisionedPackage -online | %{if ($_.packagename -match "Microsoft.Office.Desktop") {$_ | Remove-AppxProvisionedPackage -AllUsers}}

uninstall microsoft office desktop apps on windows 10 with powershell

Check out the article on how to remove built-in Microsoft Store apps from Windows.

In Windows, you can use the Get-Package and Uninstall-Package cmdlets to uninstall any application, including Win32, UWP, and MSI apps.

Get-Package -Name "*Office*" | Uninstall-Package

After completely removing all remnants of previous Office versions, you can deploy a new, clean copy of Microsoft Office without worrying about activation issues caused by residual files from previous installations.

14 comments
4
Facebook Twitter Google + Pinterest
Microsoft OfficeWindows 10Windows 11Windows Server 2022
previous post
Install and Configure SNMP Service on Windows Server and Windows 10/11
next post
How to Reset an Active Directory User Password

Related Reading

Install KMS Activation Server (Vlmcsd) on Linux

September 30, 2025

Fix: Signature Button Not Working in Outlook 2019/2016/365

March 11, 2024

Outlook Keeps Asking for Password on Windows

March 17, 2024

How to Increase Attachment Size Limit in Outlook

March 15, 2024

Microsoft Office Volume Activation Using KMS Server

February 24, 2025

How to Check the Activation Status of MS...

March 17, 2024

Fix: Microsoft Outlook Search Not Working on Windows...

March 17, 2024

How to Manually Configure Exchange or Microsoft 365...

March 17, 2024

14 comments

Lorenzo June 5, 2019 - 10:13 am

June 5th 2019. It worked fine for me on a residual Office 365 32 bit installation that did not let me install the 64 bit version. Thank you very much.

Reply
Phil August 11, 2020 - 10:05 am

Say for example, I want to remove Office 2013 using SCCM, where would I put that command line?
“%SystemRoot%\System32\cmd.exe” /C “NativeCScript.cmd //B //NoLogo “2013\OffScrub_O15msi.vbs” ALL /Quiet /NoCancel /Force /OSE”

Reply
Danny July 28, 2021 - 4:24 pm

I’d like to remove Office 2013, Office 365, and Office 2010 using SCCM. Can you send me instructions? (for ex, where do I save these OffScrub scripts and NaviteCScript.cmd?, how do I run thise command: “%SystemRoot%\System32\cmd.exe” /C “NativeCScript.cmd //B //NoLogo “2013\OffScrub_O15msi.vbs” ALL /Quiet /NoCancel /Force /OSE”?, do we only need to create a script to run or have to create a package with program on it?). Thank you very much for your helps.

Reply
admin July 29, 2021 - 9:07 am

Create a new package with all the required script files. Create a bat file with commands from the post and advertise it to clients.

Reply
Danny Pham August 2, 2021 - 11:57 pm

Do I have to use to NativeCScript.cmd? Where do I store this command? I test cscript.exe on local computer and it works fine. Just kind confuse when tried to implement it on SCCM. Can you send me a clear step by step instructions? Appreciate for your helps.

Reply
Danny August 3, 2021 - 10:08 pm

If all of our Configuration Manager clients are 64-bit, then we don’t need to use NativeCScript.cmd. How the command that we need to run on SCCM look like?

Reply
Prajyot November 16, 2021 - 2:15 pm

Hi,
When I run the offscrubc2r.vbs as an SCCM package, as a part of the removal it kills the explorer.exe. however at the end explorer.exe does not restart. I am guessing, it is starting but in the system context how do I start it in logged on users context?

Reply
serg July 18, 2022 - 1:07 pm

This appears to uninstall Office 2019 and earlier…
For remove Office 2021:
“C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeClickToRun.exe” scenario=install scenariosubtype=ARP sourcetype=None productstoremove=ProPlus2021Volume.16_en-us_x-none culture=en-us version.16=16.0

Reply
Serg September 21, 2022 - 4:21 am

When i run the package from software center or CcmCache i get a

01: Unidentified Argument Found

Scenario finished with exit code: [1].

In the program i use a uninstall command line:
SaRACmd.exe -S OfficeScrubScenario –AcceptEula -Officeversion All

The command line works when i use it to test the saracmd.exe and it uninstall all the office versions

BUT it does not work when i deploy the package OR test the command line from ccmcache.

Reply
Artem June 30, 2024 - 10:50 am

I realize that this is an old post but maybe it will help someone.
For some reason there is a wrong dash before the ‘AcceptEula’. It solved my problem. Sadly the script could not remove my office 2021.

Reply
Paul Rosenfeld November 11, 2022 - 7:53 pm

This was amazingly good and helped me take hold of a vexing issue in my O365 tenant. Thank you SO MUCH!

Reply
Satish C November 30, 2022 - 4:36 pm

Hi Paul, can provide me steps to uninstall old versions like MS Office 2013 with above scrips through SCCM.
Iam trying but no luck

Reply
AverageUser2024 January 21, 2024 - 3:18 am

This tool doesn’t work for post latest version of 2023 for O365, 2021 and 2024. Let me know if there is new fix!

Reply
Sandra September 5, 2024 - 7:32 am

Thank you so much, I was not able to uninstall the office 2016 from the control panel, but it was successful to uninstall with the tool , then i managed to install the office 2021 and activate it , it worked without any problem !

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • How to Remove Old (Unused) PowerShell Modules

    January 12, 2026
  • How to Move (Migrate) Existing Windows Shares to a New File Server

    December 24, 2025
  • Using KDC (Kerberos) Proxy in AD for Remote Access

    December 23, 2025
  • Windows: Create (Install) a Service Manually

    December 16, 2025
  • Windows: Auto Switch to Strongest Wi-Fi Network

    December 10, 2025
  • How to Enable or Disable VBScript in Windows after Deprecation

    December 10, 2025
  • Start Menu Not Working (Unresponsive) on Windows Server RDS

    November 27, 2025
  • AppLocker: Configure Application Restriction Policies in Windows

    November 19, 2025
  • Enable/Disable Random Hardware (MAC) Address for Wi-Fi on Windows

    November 14, 2025
  • Automate Software and Settings Deployment with WinGet Configure (DSC)

    November 13, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Fix: Signature Button Not Working in Outlook 2019/2016/365
  • Outlook Keeps Asking for Password on Windows
  • Microsoft Office Volume Activation Using KMS Server
  • Install KMS Activation Server (Vlmcsd) on Linux
  • How to Extend Office 2021/2019/2016 & Office 365 Trial Period
  • How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016
  • Read and Write Excel (XLSX) Files with PowerShell
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top