Windows
View all Worklets
WindowsWindows

Office Click-To-Run Uninstaller

Removes Click-to-Run Office 2013, 2016, and Microsoft 365 from Windows endpoints using the Office Deployment Tool

Worklet Details

What the Click-to-Run uninstaller does

This Automox Worklet™ removes Click-to-Run (C2R) installations of Microsoft Office 2013, 2016, and Microsoft 365 from Windows endpoints. The evaluation phase checks the registry key HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration on the endpoint. The 64-bit registry view is used on x64 systems and the native key on 32-bit systems, so the same Worklet covers both architectures.

The remediation phase builds an XML configuration in memory with a <Remove All="TRUE"> element, the display level you configure, and a FORCEAPPSHUTDOWN property. The Worklet copies setup.exe (the Office Deployment Tool) and the generated update.xml to %WINDIR%\Temp, then registers a scheduled task named Uninstall C2R Office that runs the ODT against the configuration file in the USERS context.

Two policy variables drive behavior. $visibility accepts Full (prompt the signed-in user before uninstall) or None (silent removal with no UI). $appClosure accepts TRUE to force-close Word, Excel, Outlook, PowerPoint, and OneNote during removal, or FALSE to wait for the user to save and close open documents. When $visibility is set to Full, the Worklet registers the task and exits, leaving the next evaluation pass to confirm removal and clean up the task. When $visibility is set to None, the Worklet polls the task state until it reports Ready, unregisters the task, and re-reads the ClickToRun key to confirm removal.

Why pull Click-to-Run off the fleet

Click-to-Run and traditional MSI Office cannot coexist on the same Windows endpoint, and two C2R channels (Current, Monthly Enterprise, Semi-Annual) also cannot run side by side. Any migration between Office editions, channels, or licensing models starts with a clean uninstall on every endpoint in scope.

Microsoft documents the removal path through the Office Deployment Tool with a configuration XML containing <Remove All="TRUE">. Running that by hand means RDP sessions, Programs and Features, or SCCM scrub packages on each endpoint. This Worklet applies the ODT removal across every Windows endpoint in your policy scope, then re-checks HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration on the next evaluation pass so you can verify the result on each endpoint instead of trusting a single run.

How the Click-to-Run removal works

  1. Evaluation phase: The script opens HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration using the 64-bit RegistryView API on 64-bit Windows and Get-Item on 32-bit Windows. A present key returns exit code 1 and flags the endpoint for remediation. A missing key returns exit code 0 and the policy takes no further action on that endpoint.

  2. Remediation phase: The script checks for an existing Uninstall C2R Office scheduled task and cleans up any stale instance from a previous run. It re-confirms the ClickToRun key is still present, generates update.xml in memory, and writes it to disk. Both setup.exe and update.xml are copied into %WINDIR%\Temp so the uninstall survives Worklet exit. The scheduled task is registered to run setup.exe with /configure update.xml in the USERS context. When $visibility is Full, the script exits and lets the user respond. Otherwise it polls the task state until Ready, unregisters the task, and re-reads the ClickToRun key. The Worklet exits 0 on a confirmed removal, or 1 with a pointer to the logs in %WINDIR%\Temp if the key is still present.

Click-to-Run removal requirements

  • Windows 8.1 or later, workstation or server, with PowerShell 3.0 or later available to the Automox agent

  • Office Deployment Tool (setup.exe) uploaded as a file attachment on the Worklet policy; download the latest version from https://aka.ms/ODT

  • A Click-to-Run installation of Office 2013, 2016, or Microsoft 365 on the target endpoint; MSI-based installs are not handled here and need the OffScrubC2R or OffScrub script set

  • Set $visibility to Full (display the Office uninstaller UI to the user) or None (silent removal with no UI)

  • Set $appClosure to TRUE to let the ODT close open Office apps automatically, or FALSE to wait for the user; pair FALSE only with $visibility = 'Full', since a silent run with FALSE will wait forever for an unprompted user

  • Local administrator context for the Automox agent so the policy can write to %WINDIR%\Temp and register a scheduled task under the USERS principal

Expected endpoint state after removal

After a successful run, the registry key HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration is gone, the ClickToRunSvc service is removed, and Word, Excel, PowerPoint, Outlook, OneNote, and other C2R components are no longer launchable. The C:\Program Files\Microsoft Office and C:\Program Files (x86)\Microsoft Office directories are cleared of the C2R installation tree, while user data under %APPDATA%\Microsoft is preserved. The endpoint is ready to accept a fresh Office install through any channel, including a different C2R configuration or an MSI-based deployment.

The Worklet writes Successfully uninstalled Click-To-Run Office to the activity log on exit code 0. A failure emits ERROR: Uninstall failed - See logs at %WINDIR%\Temp and exit code 1, which Automox surfaces in the policy run summary. ODT writes its own diagnostic logs to %TEMP%\Microsoft Office Setup(*).log under the user that triggered the scheduled task. After visibility-Full runs, schedule the same Worklet to re-evaluate; the next pass cleans up the leftover scheduled task and confirms the endpoint is clear of Click-to-Run.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklets deploy named-CVE mitigations within hours of disclosure, perform configuration, remediation, and install or remove applications and settings across Windows, macOS, and Linux.

do more with worklets