Modifying Office Installations and Changing Office Editions with MAS: Complete Technical Guide

Microsoft Activation Scripts (MAS) enables advanced modification of Office Click-to-Run installations through a menu-driven batch interface that orchestrates OfficeClickToRun.exe commands to add, remove, or reconfigure product editions without full reinstallation.

The massgravel/Microsoft-Activation-Scripts repository provides system administrators and power users with automated tools for Microsoft product management. Modifying Office installations and changing Office editions with MAS is handled primarily through MAS/Separate-Files-Version/Change_Office_Edition.cmd, a self-contained script that interacts directly with the Office Click-to-Run (C2R) service to manipulate product SKUs, application sets, and update channels via native command-line parameters.

How MAS Modifies Office Click-to-Run Installations

MAS does not rely on external installers or Microsoft deployment tools. Instead, it invokes OfficeClickToRun.exe—the native Office C2R client—with specific command-line arguments constructed dynamically based on user input.

Detecting Existing Office Configurations

Before any modification, the script verifies the current Office state by reading registry keys under HKLM\SOFTWARE\Microsoft\Office\ClickToRun. The ch_getinfo function extracts critical data including the installation path, architecture (x86/x64/ARM), current update channel, installed languages, version number, and existing product IDs. These pre-flight checks (implemented throughout the script, notably at lines 68-78) ensure the target system meets requirements: Windows 7 through 11, active Click-to-Run presence, Internet connectivity verified via oe_chkinternet, and running Null service.

Adding and Changing Product Editions

oe_editionchange (lines 1159-1175) constructs a c2rcommand string that invokes OfficeClickToRun.exe with the productstoadd parameter. The function appends the desired SKU—such as ProPlus2021Retail or ProjectRetail—along with the .16 suffix indicating Office 2016 and later, and culture identifiers (e.g., en-us). The command automatically includes the cdnbaseurl.16 parameter pointing to the appropriate Microsoft CDN for the selected channel.

Removing Installed Editions

oe_removeedition (lines 1187-1199) handles edition removal by building a command using the productstoremove parameter. This routine specifies the target SKU to uninstall (e.g., VisioVolume.16) without affecting other installed Office products. The script parses user selection from the interactive menu and validates the SKU exists in the current installation before execution.

Customizing Application Inclusion

oe_excludeapps (lines 1086-1118) enables granular control over individual applications when adding suites. The script generates an excludelist based on user toggles in the text-based UI, translating these selections into the excludedapps.16 parameter. Common exclusions include groove (OneDrive for Business) or teams, formatted as comma-separated values appended to the execution string.

Managing Update Channels

Changing the Office update channel requires registry manipulation followed by client update forcing. oe_cleanupreg (lines 1249-1275) updates the CDNBaseUrl value under HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration to point to the desired channel (e.g., Monthly Enterprise, Insider, or Perpetual). The oe_changeupdchnl routine then triggers OfficeC2RClient.exe /update user to apply the channel switch immediately.

Workflow Architecture and Execution Flow

The script follows a modular, label-driven architecture common to advanced batch files, with clear separation between initialization, detection, menu presentation, and execution phases.

Initialization and Privilege Elevation

Upon launch, the script performs environment setup and path sanitization (lines 43-57), detecting the system architecture to ensure compatibility with x64 or ARM64 Office installations. If not running with administrative privileges, the script automatically re-launches using runas (lines 87-95), ensuring the subsequent registry writes and Office service interactions succeed.

Interactive Menu System

The :oemenu label (lines 84-108) presents a numbered interface offering five primary actions: change all editions, add edition, remove edition, add/remove individual apps, and change update channel. User input branches execution to dedicated subroutines: oe_edition, oe_editedition, oe_removeedition, or oe_changeupdchnl.

Dynamic SKU Discovery

Before presenting edition options, MAS generates temporary text files (SingleApps_*.txt and Suites_*.txt) via PowerShell extraction within the :getlist subroutine. These files enumerate available Retail and Volume SKUs based on the detected Office version, ensuring users select compatible product codes.

Command Execution and Error Handling

Each subroutine constructs the final c2rcommand string, executes it via cmd /c, and captures %errorlevel% to determine success. The script provides contextual feedback, directing users to troubleshooting URLs (%mas%troubleshoot) when OfficeClickToRun.exe returns non-zero exit codes.

Practical Usage Examples

The following examples demonstrate common scenarios for modifying Office installations and changing Office editions with MAS from an elevated command prompt.

Launching the Edition Manager

:: Navigate to the MAS directory and execute the edition changer
MAS\Separate-Files-Version\Change_Office_Edition.cmd

Adding a Retail Suite Interactively

When the menu appears, selecting Option 1 (Change all editions) → Option 1 (Office Suites - Retail) displays available SKUs. Choosing ProPlus2021Retail generates and executes:

"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeClickToRun.exe" platform=x64 culture=en-us productstoadd=ProPlus2021Retail.16_en-us cdnbaseurl.16=http://officecdn.microsoft.com/pr/...

Removing a Specific Edition

From the main menu, selecting Option 3 (Remove edition) and choosing the Visio Volume SKU produces:

"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeClickToRun.exe" platform=x64 productstoremove=VisioVolume.16

Excluding Applications During Installation

During the "Add edition" workflow, the UI displays toggles for each application. Disabling Teams modifies the command to include:

... excludedapps.16=groove,teams ...

Changing to Monthly Enterprise Channel

Selecting Option 5 (Change Office update channel) triggers registry updates:

reg add "HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" /v CDNBaseUrl /d "https://officecdn.microsoft.com/pr/..." /f

Followed by:

"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /update user

Silent Deployment Scripting

For automated deployments, pass the -el flag to force elevation and skip the UI (parsed at lines 33-41), then supply arguments directly:

set _args=productstoadd=ProPlus2021Retail.16_en-us cdnbaseurl.16=http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60
MAS\Separate-Files-Version\Change_Office_Edition.cmd -el %_args%

Key Implementation Files

Understanding the repository structure clarifies how MAS components interact:

  • Change_Office_Edition.cmd: The primary orchestration file containing all edition modification logic, helper functions (dk_color, oe_chkinternet), and the main menu system.
  • MAS_AIO.cmd: All-in-One wrapper capable of invoking the separate-file version for consolidated deployments.
  • Activators/Online_KMS_Activation.cmd: Provides Volume Activation Services (KMS) activation following edition changes to Volume-licensed SKUs.
  • Activators/TSforge_Activation.cmd: Hardware-based activation alternative referenced by the main UI for permanent digital license generation.

Summary

Modifying Office installations and changing Office editions with MAS provides a robust, scriptable alternative to the Office Deployment Tool. Key technical takeaways include:

  • Native C2R Integration: MAS manipulates Office installations by constructing valid OfficeClickToRun.exe command strings with productstoadd, productstoremove, and excludedapps parameters.
  • Self-Contained Architecture: All helper functions—including ch_getinfo for detection and oe_cleanupreg for channel management—reside within Change_Office_Edition.cmd, requiring no external dependencies beyond standard Windows utilities.
  • Registry-Backed Channel Management: Update channel switches modify HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration\CDNBaseUrl and force immediate client updates via OfficeC2RClient.exe.
  • Modular UI Design: The script supports both interactive menu-driven operation and silent execution via command-line flags (-el, re1, re2, -qedit), enabling integration with enterprise deployment pipelines.

Frequently Asked Questions

Can MAS modify Office installations without internet connectivity?

No, the script requires active Internet connectivity to download additional language packs or new edition components. The oe_chkinternet function verifies connectivity before attempting C2R operations, as OfficeClickToRun.exe must reach Microsoft CDNs to acquire new SKUs or update channel metadata.

Does changing Office editions with MAS require reinstalling Windows or Office completely?

No, MAS performs in-place modifications using the Office Click-to-Run servicing model. The productstoadd and productstoremove parameters trigger C2R to download only differential components needed for the new edition, preserving user settings, documents, and existing applications not targeted for removal.

What is the difference between the Separate-Files-Version and All-In-One-Version for Office edition changes?

The Separate-Files-Version (Change_Office_Edition.cmd) contains the complete, isolated implementation for edition management suitable for standalone use or integration into custom workflows. The All-In-One-Version (MAS_AIO.cmd) bundles this functionality alongside Windows activation and other MAS features, invoking the separate files as needed but providing a unified entry point for users requiring multiple MAS capabilities.

How does MAS handle architecture detection for mixed x64 and ARM installations?

During initialization (lines 43-57), the script detects the host architecture and Office installation bitness, storing these in environment variables. When constructing OfficeClickToRun.exe commands, MAS appends the correct platform=x64 or platform=arm64 parameter, ensuring compatibility with Windows on ARM devices and preventing architecture mismatches during edition modification.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →