Deploying Microsoft Office 2016: Removing Old Versions

For the last few weeks, we’ve been building application packages to serve as prerequisites for Office 2016 installation. Today, we’ll tackle one last preparatory issue before actually constructing the Office 2016 Application in Configuration Manager.

As we’ll see next week, Office 2016 has numerous options that can be set at installation time. One of these options instructs the Office Setup program to uninstall previous versions of Office before beginning the installation process. This is great because having multiple versions of Office installed just doesn’t work in several combinations, and in others, it is supported but not recommended. See Install and use different versions of Office on the same PC for links to additional details.

Unfortunately, this fantastic feature of the Office setup program doesn’t actually work! During setup, if the currently installed (old) version of Office contains a program (e.g., SharePoint Designer 2010) that has been eliminated from the product in the current version, the setup program can’t remove it. Also, if the existing installation is damaged in some way, it may not be able to be uninstalled reliably. Therefore, if we want a clean upgrade experience for existing installations, we have to find another method to remove previous versions of Office.

The Office Deployment Support Team Blog provides the answer. In the post, How to uninstall Office 2010 and move to Office 2013 (Click to Run or Volume License), the author writes:

Utilizing Offscrub is the best method of removing a previous version of Office. It will call setup.exe and MSIExec to remove the bits. It is best equipped to deal with machine or software corruption and completely removes Office app shortcuts for the previous version. We recommend using Offscrub in almost every situation of moving from Office 2010 to Office 2013.

What is this “OffScrub” program? OffScrub is the underlying VBScript program that runs when you download and run a Microsoft FixIt program to remove Office. We’re going to follow the Office Deployment Support Blog’s suggestion and use this technology to reliably remove all previous versions of Office back to Office 2003 before installing Office 2016. Let’s get started.

Acquiring the Script Files

I am going to walk through all of the steps below, but you may want to take a moment to go read How to obtain and use Offscrub to automate the uninstallation of Office products from the Office Deployment Support Blog. That is a major source for this post.

Download the FixIt Programs

Let me save you some time. I downloaded seven separate FixIt files for various versions of Office and Windows. For each version of Office, one package is available for Windows 7 and lower, and another package is available for Windows 8 and higher. It turns out that the OffScrub*.vbs file is the same in both packages. (There is one exception: The Windows 7 Offscrub03.vbs for Office 2003 is missing one of the subroutines that it calls—a bug—but the subroutine exists in the Windows 8 version.) Therefore, you will only have to download four FixIt files. We’ll use the Windows 8 versions because they are easier to extract and don’t have the bug mentioned above.

  1. Browse to the Microsoft Support article, How to uninstall Office 2003, Office 2007 or Office 2010 suites if you cannot uninstall it from Control Panel.
  2. Download each of the FixIt programs available on that page for Windows 8. Save them in folders named for the year of the Office version followed by a hyphen and the applicable OS platforms:
    • 2003-Win8
    • 2007-Win8
    • 2010-Win8

    Note: There is a FixIt listed separately for Office 2010 on Windows 10 in the Office Support article, Uninstall or remove Office 2010. As with the Windows 7 version, this FixIt is the same as the one listed here for Windows 8.

  3. Browse to Uninstall Office 2013, Office 2016, or Office 365 from a Windows computer.
  4. Download the “easy fix tool” into a folder named “2013-2016-O365-Win”.

I wanted to show you where all of the files came from, but for reference, here are direct links to all of them:

Windows 7 & earlier
(Shaded links aren’t needed for this blog post.)
Windows 8 Windows 10
Office 2003 MicrosoftEasyFix50416.msi MicrosoftFixit20054.mini.diagcab No FixIt available
Office 2007 MicrosoftEasyFix50154.msi MicrosoftFixit20052.mini.diagcab  No FixIt available
Office 2010 MicrosoftEasyFix50450.msi MicrosoftFixit20055.mini.diagcab
Office 2013/2016 O15CTRRemove.diagcab

Based on the fact that the Office 2010 FixIt files are the same for Windows 10 and all other Windows versions, I am going to assume that the same is true for Office 2003 and 2007.

Extract the OffScrub Scripts

Now we must depart a bit from our instructions, which predate the release of Windows 8. The FixIt programs we downloaded are packaged in DIAGCAB files. DIAGCAB files work with the Windows Troubleshooting Platform, but architecturally, they are just CAB files, so we can extract their contents with the expand command.

On your application staging file share (wherever you put application source files for Configuration Manager to find), create a folder structure for the OffScrub scripts. Mine will be \\fileserver\software$\Microsoft\OffScrub with a subfolder for each Office version. Make the appropriate changes for your environment in the commands below, and then run them.

rem Change the path to match the parent of all of the folders created earlier.
rem This can also be a network path, like \\server\share\OffScrubDownloads
set OFFSCRUBSOURCE=E:\OffScrubDownloads
set OFC2003WIN8=%OFFSCRUBSOURCE%\2003-Win8
set OFC2007WIN8=%OFFSCRUBSOURCE%\2007-Win8
set OFC2010WIN8=%OFFSCRUBSOURCE%\2010-Win8
set OFC20132016=%OFFSCRUBSOURCE%\2013-2016-O365-Win

rem Change the path to match your Configuration Manager application source location.
set OFFSCRUBDESTINATION=\\fileserver\software$\Microsoft\OffScrub
md "%OFFSCRUBDESTINATION%\2003"
md "%OFFSCRUBDESTINATION%\2007"
md "%OFFSCRUBDESTINATION%\2010"
md "%OFFSCRUBDESTINATION%\2013"
md "%OFFSCRUBDESTINATION%\2016"
md "%OFFSCRUBDESTINATION%\C2R"

rem Use the EXPAND command to extract the OffScrub files (-f) from the DIAGCAB files, which are really just CAB files with specialized contents, and disregard internal folder structure (-i).
expand -i "%OFC2003WIN8%\MicrosoftFixit20054.mini.diagcab" -f:OffScrub*.vbs "%OFFSCRUBDESTINATION%\2003"
expand -i "%OFC2007WIN8%\MicrosoftFixit20052.mini.diagcab" -f:OffScrub*.vbs "%OFFSCRUBDESTINATION%\2007"
expand -i "%OFC2010WIN8%\MicrosoftFixit20055.mini.diagcab" -f:OffScrub*.vbs "%OFFSCRUBDESTINATION%\2010"
expand -i "%OFC20132016%\O15CTRRemove.diagcab" -f:OffScrub*.vbs "%OFFSCRUBDESTINATION%\2013"
move /y "%OFFSCRUBDESTINATION%\2013\OffScrub_O16msi.vbs" "%OFFSCRUBDESTINATION%\2016"
move /y "%OFFSCRUBDESTINATION%\2013\OffScrubc2r.vbs" "%OFFSCRUBDESTINATION%\C2R"

The expand commands above extract just the VBS files that we need from the DIAGCAB files.

Update from 2016-04-03

Subsequent to this blog post’s initial publication, testing showed that while all of the extracted scripts work correctly when run manually, they fail on 64-bit Windows when run from inside a Configuration Manager Package. It turns out that even in Configuration Manager v1511, the engine that executes package programs is run in a 32-bit process on 64-bit Windows. That means that calls to cscript.exe on 64-bit Windows will use the SysWOW64 version of cscript.exe and will get the special modified view of the system provided for 32-bit processes. This prevents the scripts from adequately searching through the entire system and effectively removing Office programs. I added the following section to deal with this issue.

Overriding the File System Redirector

In order to work properly, the Offscrub scripts must all run in the native bitness of the platform. On 64-bit Windows, that means we must directly call the native cscript.exe program when running from within a Configuration Manager Package. In order to keep the package programs platform neutral, I wrote a small script to use in place of cscript.exe that figures out which cscript.exe to call, and then does so. I am indebted to Andrew Lukaszewski, whose generic script to overcome this issue inspired the more specific script below.

Copy the following into a plain ANSI text file and save it as CScriptNative.cmd in the root of the Offscrub folder structure. (Mine is \\fileserver\software$\Microsoft\OffScrub\CScriptNative.cmd.)

@echo off
rem CScriptNative.cmd
rem Author: Jay Michaud (www.deploymentmadscientist.com)
rem Date: 2016-03-02
rem Source: http://www.deploymentmadscientist.com/2016/02/08/deploying-microsoft-office-2016-removing-old-versions/
rem Acknowledgement: Inspired by Andrew Lukaszewski's blog at https://madluka.wordpress.com/2012/09/24/configmgr-2012-64bit-file-system-redirection-bites-again/
rem Description: Use this command script in place of cscript.exe to ensure that the script runs as a 64-bit process on 64-bit operating systems.
rem This is useful when deploying a script as a package program in Microsoft System Center Configuration Manager, where the engine that runs the package program is a 32-bit process on 64-bit Windows.
rem Example: Instead of
rem cscript.exe //B //NoLogo "\\server\share\path\to\my script.vbs"
rem run
rem NativeCScript //B //NoLogo "\\server\share\path\to\my script.vbs"

rem On 32-bit Windows, the PROCESSOR_ARCHITEW6432 environment variable is not defined by the operating system.
rem On 64-bit Windows, the PROCESSOR_ARCHITEW6432 environment variable is not defined by the operating system in 64-bit processes.
rem On 64-bit Windows, the PROCESSOR_ARCHITEW6432 environment variable is defined by the operating system in 32-bit processes as "AMD64" (without quotation marks).

if "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
rem Currently running as 32-bit process on 64-bit Windows (SysWOW64)
rem Launch CScript through Sysnative
"%SystemRoot%\Sysnative\cscript.exe" %*
) else (
"%SystemRoot%\System32\cscript.exe" %*
)

If the script detects that it is running in a 32-bit process on 64-bit Windows, it calls the 64-bit cscript.exe directly, bypassing the File System Redirector, by calling "%SystemRoot%\Sysnative\cscript.exe". Otherwise, it calls the native cscript.exe located in the System32 folder.

Building the Configuration Manager Package

In the previous blog posts in this series, I have been using the phrase “application package” and the word “Application” (capitalized) interchangeably to refer to an Application object in Configuration Manager. Because the OffScrub VBS scripts perform a task and don’t actually install anything, an Application will not work. Instead, we will build a single Configuration Manager Package to hold all of the scripts.

Please consult the TechNet documentation for assistance in building a ConfigMgr Package: Packages and programs in System Center Configuration Manager. Here are the specifics.

Property Value
Package Properties
Name Microsoft OffScrub
Description Collection of program removal scripts for Office 2003, 2007, 2010, 2013, 2016, and Office 365 from Microsoft PSS.
Manufacturer Microsoft
Language Leave blank
Version Leave blank
 This package contains source files Checked
Source folder \\fileserver\software$\Microsoft\OffScrub
Standard Program Properties – Office 2003
Name OffScrub03
Command line "%SystemRoot%\System32\cmd.exe" /C "CScriptNative.cmd //B //NoLogo "2003\OffScrub03.vbs" ALL /Quiet /NoCancel /Force /OSE"
Startup folder Leave blank
Run Hidden
Program can run Whether or not a user is logged on
Run mode Run with administrative rights (selection is disabled)
Allow users to view and interact with the program installation Unchecked
Drive mode Runs with UNC name
 Run another program first Unchecked
 This program can run only on specified platforms On any platform

Note that these scripts will only run on Windows, but in my environment, the 32-bit versions of Windows 8 and 8.1 are not present in this list, so I could not use this list to filter where this package would appear. I do not know if their absence is a bug in Configuration Manager or a problem with my organization’s ConfigMgr environment. In any case, I need these scripts to run on 32-bit Windows, so I must specify “On any platform” in order to have the above-mentioned platforms included.

Estimated disk space 146 KB
Maximum allowed run time (minutes) 120 (the default)

All of the scripts names are unique, so they all could have been placed into the same folder. Putting each script into its own folder allows this package to grow easily in the future even if Microsoft releases an OffScrub script with the same name as an existing one.

The Run, Program can run, and Run mode properties indicate silent installation and are typical for programs that need to be deployed as “required” or in a task sequence. My plan is to deploy this in a task sequence.

The command line deserves some explanation. Our instructions recommend not using the Force switch because it can cause users to lose data. I looked at the source code of the command line argument handling and the declarations of the flags that are set by those arguments. The reason for that warning is that the Force switch causes the Office programs to exit if they are running, presumably without allowing the user to save his/her data. Because I am planning to deploy this only in a task sequence, I will include a reboot step prior to running any OffScrub scripts; that will prevent any user from having an Office application running when the script starts.

Our instructions further recommend that we bypass stage 1 (/Bypass 1) when automating Office uninstallation because it can trigger repairs in some products. I took a look at the source code to see what stage 1 actually accomplishes, but I didn’t get very far because I noticed that if the Force switch is passed, the Bypass switch is ignored for stage 1. Since I am passing the Force switch to ensure a complete uninstallation, there is no point in passing the Bypass switch just to have it be ignored.

Each of these scripts automatically logs several different files of output to %TEMP% without any need to specify the /Log switch. While you are testing this package, check there to see if anything is going awry.

The rest of the programs are nearly identical to the first one we built above. I will list below only the properties that differ. Set all other properties to the same values as those in the Office 2003 program.

Property Value
Standard Program Properties – Office 2007
Name OffScrub07
Command line "%SystemRoot%\System32\cmd.exe" /C "CScriptNative.cmd //B //NoLogo "2007\OffScrub07.vbs" ALL /Quiet /NoCancel /Force /OSE"
Estimated disk space 172 KB
Standard Program Properties – Office 2010
Name OffScrub10
Command line "%SystemRoot%\System32\cmd.exe" /C "CScriptNative.cmd //B //NoLogo "2010\OffScrub10.vbs" ALL /Quiet /NoCancel /Force /OSE"
Estimated disk space 181 KB
Standard Program Properties – Office 2013
Name OffScrubO15
Command line "%SystemRoot%\System32\cmd.exe" /C "CScriptNative.cmd //B //NoLogo "2013\OffScrub_O15msi.vbs" ALL /Quiet /NoCancel /Force /OSE"
Estimated disk space 364 KB
Standard Program Properties – Office 2016
Name OffScrubO16
Command line "%SystemRoot%\System32\cmd.exe" /C "CScriptNative.cmd //B //NoLogo "2016\OffScrub_O16msi.vbs" ALL /Quiet /NoCancel /Force /OSE"
Estimated disk space 363 KB
Standard Program Properties – Office Click to Run
Name OffScrubC2R
Command line "%SystemRoot%\System32\cmd.exe" /C "CScriptNative.cmd //B //NoLogo "C2R\OffScrubc2r.vbs" ALL /Quiet /NoCancel /OSE"

Note: While the C2R script tests an internal fForce flag value, it does not process a /Force switch, so it is omitted here.

Estimated disk space 265 KB

Finally, now that all of the programs are created in the package, we must edit one property not available during program creation. Open each program, and on the Advanced tab, check the Allow this program to be installed from the Install Package task sequence without being deployed box.

We now have a Configuration Manager Package that can remove all traces of any version of Microsoft Office back to 2003.

Coming Up

Next time, we will look at the Office 2016 setup program and how to customize it for silent installation through Configuration Manager.

<update date=”2016-02-21″>Added instruction to allow installation in a task sequence without being deployed.</update>

<update date=”2016-03-03″>Changed paths so that each script has its own folder. Removed /Log switch from all scripts because they all log to %TEMP% by default. Added warnings about failure on 64-bit operating systems.</update>

<update date=”2016-04-03″>Removed 64-bit warnings. Added “Overriding the File System Redirector” section and updated program command lines to use CScriptNative.cmd instead of cscript.exe.</update>

30 thoughts on “Deploying Microsoft Office 2016: Removing Old Versions”

  1. Dear DMS – Brilliant!
    I am looking only to do a thorough UNinstall of Office 365 Home (Office 16) from a single Win 7 Pro 64-bit machine. I already have O15CTRRemove.diagcab from your link above. (And I also downloaded it earlier from other links as o15-ctrremove.diagcab, with a hyphen in the file name but with the same file size – any difference?)
    If I open cmd as administrator, what would be the single command line to run either O15CTRRemove.diagcab (easier for me) or offscrub?.vbs (more work for me) in the strongest flavor? (I assume I would first have to create your CScriptNative.cmd.)
    I ask because each effort to UNinstall and then REinstall Office 365 Home (Office 16) throws up 60 – 70 Warnings in Event Viewer (Event 1039) of “Product: Office 16 Click-to-Run Extensibility Component. The application tried to modify a protected Windows registry key \msinkdiv.InkDivider.1.” And with a different key for each of the 60-70 Warnings.
    I am hoping your approach will delete these keys as well, so I can then do a REinstall without those Warnings.
    By the way, O365 is working on the PC, but I don’t like those Warnings.
    Many thanks.

    1. By the way, when I “expand -d” O15CTRRemove.diagcab, it shows me the following contents, and there are THREE offscrub?.vbs files. Which ones should I run, and with what parameters to try to get rid of those 60-70 non-modifiable registry keys? Also, might there be more offscrub?.vbs files in the first sub-cab?

      o15ctrremove.diagcab: cleanospp.cab
      o15ctrremove.diagcab: CL_Office.ps1
      o15ctrremove.diagcab: cl_office.psd1
      o15ctrremove.diagcab: DiagPackage.cat
      o15ctrremove.diagcab: DiagPackage.diagpkg
      o15ctrremove.diagcab: DiagPackage.dll
      o15ctrremove.diagcab: OffScrubc2r.vbs
      o15ctrremove.diagcab: OffScrub_O15msi.vbs
      o15ctrremove.diagcab: OffScrub_O16msi.vbs
      o15ctrremove.diagcab: RC_RemoveO15ClickToRun.ps1
      o15ctrremove.diagcab: rc_removeo15clicktorun.psd1
      o15ctrremove.diagcab: RS_RemoveO15ClickToRun.ps1
      o15ctrremove.diagcab: rs_removeo15clicktorun.psd1
      o15ctrremove.diagcab: TS_Main.ps1
      o15ctrremove.diagcab: utils_SetupEnv.ps1
      o15ctrremove.diagcab: VF_RemoveO15ClickToRun.ps1
      o15ctrremove.diagcab: vf_removeo15clicktorun.psd1
      o15ctrremove.diagcab: cl_office.psd1
      o15ctrremove.diagcab: en-us.cat
      o15ctrremove.diagcab: rc_removeo15clicktorun.psd1
      o15ctrremove.diagcab: rs_removeo15clicktorun.psd1
      o15ctrremove.diagcab: vf_removeo15clicktorun.psd1
      o15ctrremove.diagcab: cl_office.psd1
      o15ctrremove.diagcab: fr-FR.cat
      o15ctrremove.diagcab: rc_removeo15clicktorun.psd1
      o15ctrremove.diagcab: rs_removeo15clicktorun.psd1
      o15ctrremove.diagcab: vf_removeo15clicktorun.psd1

      1. OffScrubc2r.vbs, OffScrub_O15msi.vbs, and OffScrub_O16msi.vbs in O15CTRRemove.diagcab are for Office 365 (a.k.a. click-to-run or C2R), Office 2013, and Office 2016, respectively. The Offscrub extraction script above moves these to separate folders after extraction is complete for consistency with the other scripts, so that each ConfigMgr package contains only one script. For your scenario of removing Office 365 from a single machine, run the click-to-run script from an administrator command prompt: “%SystemRoot%\System32\cscript.exe” //B //NoLogo “\\fileserver\software$\Microsoft\OffScrub\C2R\OffScrubc2r.vbs” ALL /Quiet /NoCancel /OSE”. You could omit the /Quiet switch in order to get feedback about the script’s progress.

  2. M. Michaud – Thanks for fast reply!
    Some follow-up:
    1) As I have only the O365 installation on this Win 7 Pro 64-bit machine, and no other Office installation, would it suffice
    a) to “expand” all of the O15CTRRemove.diagcab into a single folder (called “Scrubber”), without deleting any of the .vbs files,
    b) open an administrator command prompt and then run “%SystemRoot%\System32\cscript.exe” //B //NoLogo “C:\Users\[my user name]\Downloads\Scrubber\OffScrubc2r.vbs” ALL /Quiet /NoCancel /OSE” ??
    c) Above, I have two open quotation marks “ but three close quotation marks ” so there must be something wrong?
    2) Is there any need to use CScriptNative.cmd ? Reminder my OS is 64-bit. Would that change my “long command above”, or am I IN CScriptNative.cmd when I run the command above?
    3) You wrote above that there is no “Force” parameter in my case. Wow – I really wanted that. Any other parameter I should throw in? Reminder I’m trying to delete 60+ registry keys that cannnot be modified when I do a normal UNinstall and REinstall of O365.
    Thanks. Sorry for dumb questions. But your artuicle here is my first ray of hope.

    1.    Please ignore my question 2) – got it. (Your “%SystemRoot%\System32\cscript.exe” is the 64-bit version, so good in my case.)
         But still would much appreciate thoughts on 1) and 3).
      Thanks.

      1. 1) It seems like what you are describing should work, but of course, the only way to know for sure is to test! Just remove your last set of quotation marks after the OSE switch.
        3) Regarding the missing “Force” switch, the good news is that you can inspect the source code yourself to figure out what is going on there. I don’t have any special knowledge about it; I shared everything that I learned about the script in the post above.

  3. M. Michaud – When I look at OffScrubC2R.vbs in “edit”, I see that
    fForce = False
    What might happen if I set it to True?
    Do you think that might help me uninstall or modify the 60-70 protected registry keys on my next UNinstall and REinstall of 0365 64-bit?
    I know I’m not the level of reader you normally get, but your post here has taught me quite a bit more than you realize.
    Je vous remercie.

    1. Searching the remainder of the script for “fForce” would tell you if that variable is referenced anywhere, and if so, what the effect of changing it would be. I am not sure what these “protected” registry keys are, but if you are getting “access denied” errors from the script, the registry keys may be in use, or they may have permissions set so that only the SYSTEM account can modify them. In the former case, check to see if any Office-related processes or services are running, and if so, stop and disable them. In the latter case, you could try running the script in the context of the SYSTEM account, but do that at your own risk. (PSExec from Sysinternals will allow you to do this. Use your favorite search engine to find the software and the instructions if you want to try this.)

  4. Hello Jay,

    Thank you for sharing all this information, it is very valuable.

    If you have a few moments, I encounter some problems that I do not understand during deployments and I would like to have your opinion. I followed to the letter the various steps that you propose, and I began to test the deployment of the sequence of tasks on certain workstations in my environment.

    On some machines, things go smoothly and the entire process is very fast (about 30 minutes).

    On other machines (at least 2 out of 3), the process takes up to 5 or 6 hours to achieve overall success, but if we look more closely at the deployment report of the task sequence, we realize That some steps have failed, mostly uninstalls with OffScrub, without my understanding why. In the attached report, we see that the “Remove Office 2016” and the “Remove Office Click-to-run” steps failed after two hours. I checked the “continue on error” option for each OffScrub task, otherwise it would end the sequence of tasks.

    Do you have a track regarding these problems?

    Thank you very much.

    Cordially.

    09/01/2017 17:42:04 9 Remove Office 2016 OffScrub 11135 The task sequence execution engine failed executing an action -2147024637 … atus notification…
    Waiting for job status notification…
    dwEnabled > 0, HRESULT=80004005 (e:\cm1606_rtm\sms\framework\core\ccmcore\util.cpp,3991)
    CompleteExecution received
    Received job completion notification from Execution Manager
    Installation completed with exit code 0x80070103
    Setting TSEnv variable ‘SMSTSInstallSoftwareJobID_INR000A7_INR2002B_OffScrubO16’=”
    CompleteExecution processed
    GetExecRequestMgrInterface successful
    Releasing job request, jobID='{C2EE076F-947D-432B-8722-FEDFC0A9D756}’
    Releasing of Job Request successful
    CompleteJob successful
    ReleaseSource() for C:\_SMSTaskSequence\Packages\INR000A7.
    reference count 1 for the source C:\_SMSTaskSequence\Packages\INR000A7 before releasing
    Released the resolved source C:\_SMSTaskSequence\Packages\INR000A7
    pInstall->Install(sPackageID, sProgramName), HRESULT=80070103 (e:\nts_sccm_release\sms\client\osdeployment\installsoftware\main.cpp,361)
    Installation failed with error (0x80070103)
    Install Software failed, hr=0x80070103

    09/01/2017 19:42:05 10 Remove Office Click-to-run OffScrub 11135 The task sequence execution engine failed executing an action -2147024637 … atus notification…
    Waiting for job status notification…
    dwEnabled > 0, HRESULT=80004005 (e:\cm1606_rtm\sms\framework\core\ccmcore\util.cpp,3991)
    CompleteExecution received
    Received job completion notification from Execution Manager
    Installation completed with exit code 0x80070103
    Setting TSEnv variable ‘SMSTSInstallSoftwareJobID_INR000A7_INR2002B_OffScrubC2R’=”
    CompleteExecution processed
    GetExecRequestMgrInterface successful
    Releasing job request, jobID='{2CA5A915-C2B2-445F-8C19-D4B4B2DAA3DD}’
    Releasing of Job Request successful
    CompleteJob successful
    ReleaseSource() for C:\_SMSTaskSequence\Packages\INR000A7.
    reference count 1 for the source C:\_SMSTaskSequence\Packages\INR000A7 before releasing
    Released the resolved source C:\_SMSTaskSequence\Packages\INR000A7
    pInstall->Install(sPackageID, sProgramName), HRESULT=80070103 (e:\nts_sccm_release\sms\client\osdeployment\installsoftware\main.cpp,361)
    Installation failed with error (0x80070103)
    Install Software failed, hr=0x80070103

    1. Hi jcjacques. Thanks for reading. So many of ConfigMgr’s error messages are the unhelpful equivalent of “an error occurred” that it is indeed very frustrating to troubleshoot what is going on. I see “HRESULT=80004005” a couple of places in your log, and while that is a general error code, I have seen it show up when something went wrong with distribution of a package to the distribution points (DPs). (Perhaps the machines that are failing are communicating with a DP with a bad copy of the package.) You may want to try redistributing the package or deleting it from the DPs and redistributing it. You may also want to check the Offscrub logs, which are located in %TEMP% if I recall correctly. That may give you some insight as to why they are running so long or where they are hanging. Best wishes!

  5. Hi, thanks for this article, i have just created an Offscrub package using the instructions here. It works, as in Office gets removed, but the return code sent to the the task sequence is:

    Failed to run the action: Removing Office 2010.
    The system cannot find the file specified. (Error: 80070002; Source: Windows)

    The offscrub log files show it completing successfully and ending with a return code of 0 so I can’t see why the package is returning 80070002.

    Would you be able to shed any light on what might cause this?

    Thanks

    Marc

    1. Hi Marc. Thanks for reading. Nothing is springing to mind as an obvious cause here. Sometimes in ConfigMgr, a single error can be reported several times in different ways as it makes its way through different parts of the system. You may want to check the logs again to be absolutely sure that OffScrub10.vbs is returning zero. As I covered in “Steps 3c and 3d: Remove Office 2010” of the later “Building the Task Sequence” post (2016-04-08; no. 12 in the series) OffScrub10 can return any of several different non-zero values to indicate success, so you have to work around that in the task sequence. Best wishes!

  6. Hi Jay,

    I wanted to register to basically say thank you for this amazing guide! You Rock!
    Can you point me to your guide on how did you set up Task Sequences for this? I cant seam to find it.
    Thanks again!

  7. Hello, and thanks for a great writeup.
    It seems M$ has changed the OC15ctrremove-file, as there are no .vbs files in it anylonger, only .ps1 and .psd1

    Am I missing something?

    1. Hi ullrotta. Thanks for reading!
      You are correct; this is a very different file than the one I downloaded over a year ago to write this post. Unfortunately, I’m not sure when or if I’ll have time to investigate the new version and update this post.

  8. First of all, thank you for sharing this very interesting article with us. I have one question. Is it possible to provide me the “O15CTRRemove.diagcab”. When I extract or expand this file
    there are no *.vbs scripts inside, only powershell scripts. Therefore I can not create a program for Office 2013, 2016 and Office 365.

    Thanks in advance and best regards
    Markus

  9. Thank you so much for taking the time to write such an amazing post!
    I was able to recreate the steps but unfortunately I’m having problems with the Office 2013 Uninstall… Can’t figure out why but the task sequence runs without problems for the Office 2010 uninstall but for 2013 it is not working as it should. I don’t get any errors and it seems that the job was done but when I go to Control Panel the App is still there but all messed up… It seems that it starts to uninstall but somewhere it fails to remove everything. If I run the offscrub directly in the client machine everything works as it should. I thought it could have something to do with the File System Redirection but I had an extra step in the task sequence to check the value of PROCESSOR_ARCHITEW6432 and it’s showing “AMD64”, as it should, I guess.
    Have you ever faced this problem before? Any log I could check to solve this mystery?
    Thanks in advance for your help!

    cheers!

  10. Just to add that I was able to solve the problem by removing the 2013 uninstall package and creating it again… lost 2 days with this SCCM bug… hope it helps someone with the same problem.
    Just one more question: it would be nice to be able to just run one of the offices uninstall instead of going throw all the steps in the task sequence; let’s say for instance that if 2010 version is found and uninstalled successfully, then there’s no reason to do the check of 2013 and 2016 and it could jump to the 365 installation. Is this possible?

    Cheers!

    1. I don’t think the scenario you suggest would work; at least, it would not be as reliable. Each Offscrub script performs a search-and-destroy mission for its particular version of Office, and any of them might find a partial, full, or corrupted installation. The only way to be sure that the machine is clean of all Office installations is to run all of them. With that being said, if you know, for example, that no computer in your environment has anything older than Office 2010, you could leave out the 2007 Offscrub script. I believe that is what Microsoft has done in recent releases of the Office 365 Pro Plus installer, which integrates the 2013 and 2016 Offscrub scripts.

  11. First I want to say thank you for writing this up, this whole article has helped me beyond belief. However I am running into an issue while running the OffScrubC2R. Everytime I run my task sequence, it fails at this step with the following “Failed to run the action: Remove Office C2R.
    Not enough storage is available to process this command. (Error: 80070008; Source: Windows)”, I have checked my test machine and it definitely has enough hard disk space. I have checked for this error online and some sites are saying it is the memory but my test machine has 8gb. So far I have made the change to this step to continue on error(because it seems that everything is getting uninstalled) and am currently testing it. I would prefer it to not error at all, so I was hoping you might have some insight into this. Thank you for all of your help.

    1. You’re very welcome, and thank you for reading! While I am still using the task sequence described in this blog series, I am not familiar with that error happening in the situation you describe. I suggest the following troubleshooting steps:
      1. Run the failing OffScrub command line at an administrative command prompt. If it runs without this error, then the problem has something to do with Configuration Manager or running in the SYSTEM context on your machine(s). (ConfigMgr runs everything as the SYSTEM user unless otherwise specified.)
      2. Open the OffScrubC2R script in your favorite text editor and try to determine what is returning this error code. If the script itself is returning it, the context may help you figure out the cause. Alternatively, the script may be returning an exit code from some other program or script that it is calling. In that case, hopefully that script or program will help you figure out the problem.

      Good luck!

  12. Hi
    Thanks for the great article. I have been trying to find an Office 2010 msi removal script that works on 32 and 64bit computers and this sort of works. However there is one issue I am facing that I hope you can help with.
    I have a task sequence which uninstalls Office 2010 msi, restarts, installs Office 2016 c2r and then restarts to complete the upgrade.
    I am having an issue with the uninstall Office 2010 part. I have used the command that detects the cscript if its 32 or 64bit, this part works, Office 2010 msi gets uninstalled but then it hangs and doesn’t go to the next part of the TS, the restart. I put a time out in the removal part of the TS and this works but this could be bad if the uninstall is running and doesn’t complete in time. In the smsts.log it is saying “waiting for job status notification”, I think this is because when you run it manually and the uninstall command is complete the dialogue box says “You need to restart your computer”.
    The question is what do I need to add to the Offscrub command to restart the computer once Office 2010 is uninstalled? (script used below)
    Hope you can help as this is now starting to annoy me!
    Thanks
    Br,
    Dan

    This is the command I have that removes Office 2010 on a 64bit OS:
    @ECHO OFF
    IF NOT “%PROCESSOR_ARCHITEW6432%”==”AMD64” GOTO native
    ECHO “Re-launching Script in Native Command Processor…”
    %SystemRoot%\Sysnative\cmd.exe /c %0 %*
    EXIT
    :native
    ECHO “Running Script in Native Command Processor…”

    :: Remove Office 2010
    OffScrub10.vbs ProPlus /Force /Bypass 1 /Quiet /S

  13. Thanks for the great article!

    Maybe the content of O15CTRRemove.diagcab has changed?
    When I try to extract the container there is no single *.vbs file in it.

    1. Yes. Last time I checked, Microsoft had changed the internals of these packages. I don’t plan to write about this topic further, but if you write about it or find another blogger that does, please post a link here in the comments!

    1. The CScriptNative.cmd script is an integral part of the solution I have described above. It is saved in the Offscrub folder so it is available to all of the Offscrub scripts. When you call it from any of the Offscrub package programs, it is present in the current directory for the running process, so it does not need its path specified. For example, if the Offscrub package showed up on your machine in C:\Windows\ccmcache\1a, then the path to the script would be C:\Windows\ccmcache\1a\CScriptNative.cmd.

Leave a Reply