Comprehensive MAS Command-Line Switches and Parameter Reference

MAS (Microsoft Activation Scripts) supports unattended activation via command-line switches that invoke specific modules (HWID, Ohook, TSforge, Online KMS) and modify activation behavior without user interaction.

The MAS_AIO.cmd script from the massgravel/Microsoft-Activation-Scripts repository serves as the central dispatcher, parsing global flags and delegating to specialized activation modules. This reference documents every documented switch extracted directly from the source code, enabling fully automated Windows and Office activation workflows.

Global Switches (MAS_AIO.cmd)

The master script MAS/All-In-One-Version-KL/MAS_AIO.cmd processes the following switches before routing to the appropriate activation module.

  • -el – Forces administrative elevation. If the current session lacks privileges, the script re-launches itself using runas. Implemented as if /i "%%A"=="-el" set _elev=1.

  • /HWID – Invokes the HWID activation routine. The script detects this in the unattended block and calls :HWIDActivation.

  • /HWID-NoEditionChange – Runs HWID activation without automatically changing the Windows edition. Useful on editions that natively do not support HWID. Sets _NoEditionChange=1.

  • /Ohook – Invokes the Office Ohook activation routine. Detected in the unattended block and calls :OhookActivation.

  • /K-… – Invokes the Online KMS activation routine. Any switch beginning with /K- triggers call :KMSActivation and is parsed inside Online_KMS_Activation.cmd.

  • /Z-… – Invokes the TSforge activation routine. Any switch beginning with /Z- triggers call :TSforgeActivation and is parsed inside TSforge_Activation.cmd.

TSforge Activation Switches (/Z- Parameters)

The MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd module handles the most extensive switch set, supporting Windows, ESU, Office, and advanced activation methods.

Product Selection Switches

  • /Z-Windows – Activate Windows only (default HWID-style activation). Sets _actwin=1.

  • /Z-ESU – Activate Extended Security Updates (ESU) for Windows 10/11.

  • /Z-Office – Activate all Office products including Project and Visio.

  • /Z-ProjectVisio – Activate Project & Visio only.

  • /Z-WindowsESUOffice – Activate Windows + ESU + Office in a single operation.

  • /Z-WinHost – Activate the Windows KMS host (csvlk).

  • /Z-OffHost – Activate the Office KMS host (csvlk).

  • /Z-APPX – Activate Windows 8/8.1 APPX sideloading (APPXLOB).

Advanced Method Switches

  • /Z-ID-<ActivationID> – Force activation of a specific activation ID. Multiple IDs can be supplied by repeating the switch. The parser detects the /Z-ID- prefix, extracts the GUID, and appends it to the tsids variable.

  • /Z-Reset – Reset the re-arm counter, evaluation period, tamper state, and/or key-lock.

  • /Z-SCID – Force the Static CID activation method, overriding auto-selection. Sets _actmethod=SCID.

  • /Z-ZCID – Force the Zero CID activation method. Sets _actmethod=ZCID.

  • /Z-KMS4k – Force the KMS4k activation method, used when internet connectivity is unavailable on newer builds. Sets _actmethod=KMS4k.

HWID Activation Switches (/HWID Parameters)

The MAS/Separate-Files-Version/Activators/HWID_Activation.cmd module processes hardware-based activation.

  • /HWID – Activate Windows using the HWID method. Sets _act=1.

  • /HWID-NoEditionChange – Skip automatic edition-change logic. Essential for Windows editions that do not support HWID activation.

  • -el – Request elevation (global flag, also accepted here).

Ohook Activation Switches (/Ohook Parameters)

The MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd module handles Office activation.

  • /Ohook – Activate Office (including Project/Visio) via the Ohook method. Detected globally in MAS_AIO.cmd and delegated to :OhookActivation.

  • -el – Request elevation.

Online KMS Activation Switches (/K- Parameters)

The MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd module parses switches beginning with /K-. The switch set mirrors the TSforge options:

  • /K-Windows – Activate Windows via an online KMS server.

  • /K-Office – Activate Office (including Project/Visio) via online KMS.

  • /K-WinHost – Activate the Windows KMS host (csvlk).

  • /K-OffHost – Activate the Office KMS host (csvlk).

  • /K-APPX – Activate Windows 8/8.1 APPX sideloading via online KMS.

  • -el – Request elevation.

Practical Usage Examples

Execute these commands from an elevated Command Prompt or PowerShell session.

Run HWID activation unattended with automatic elevation:

MAS_AIO.cmd /HWID -el

Activate Windows, ESU, and Office simultaneously using the Static CID method:

MAS_AIO.cmd /Z-WindowsESUOffice /Z-SCID -el

Force activation of specific activation IDs (multiple IDs allowed):

MAS_AIO.cmd /Z-ID-55c92734-d682-4d71-983e-d6ec3f16059f /Z-ID-43c9f5a8-3d2c-49f9-b2a5-6bff5b3d78ab -el

Reset evaluation periods and re-arm counters, then activate via HWID:

MAS_AIO.cmd /Z-Reset /HWID -el

Activate Office only using the Ohook method:

MAS_AIO.cmd /Ohook -el

Activate Windows via online KMS:

MAS_AIO.cmd /K-Windows -el

Summary

  • Global dispatcher: MAS_AIO.cmd parses -el, /HWID, /Ohook, /K-…, and /Z-… switches, then delegates to the appropriate activation module.
  • TSforge flexibility: The /Z- prefix offers the most granular control, supporting specific product activation (/Z-Windows, /Z-ESU, /Z-Office), custom activation IDs (/Z-ID-), and method overrides (/Z-SCID, /Z-KMS4k).
  • Edition safety: Use /HWID-NoEditionChange when activating editions that do not natively support HWID to prevent unwanted SKU changes.
  • Elevation handling: The -el switch ensures the script runs with administrative rights, re-launching via runas if necessary.
  • Unattended mode: Supplying any activation switch automatically sets _unattended=1, suppressing interactive menus.

Frequently Asked Questions

What is the difference between /Z-SCID, /Z-ZCID, and /Z-KMS4k?

These switches force specific TSforge activation methods. /Z-SCID uses the Static CID method, /Z-ZCID uses the Zero CID method, and /Z-KMS4k uses the KMS4k method designed for scenarios where internet access is unavailable on newer Windows builds. By default, the script auto-selects the appropriate method unless overridden.

Can I combine multiple activation targets in a single command?

Yes. You can combine product selectors like /Z-WindowsESUOffice to activate multiple products simultaneously, or chain individual switches such as /Z-Windows /Z-Office. You may also combine activation with reset operations using /Z-Reset to clear evaluation states before activating.

Does MAS require administrative privileges to run?

Yes. While the script can launch without elevation, activation operations require administrative rights. Use the -el switch to force elevation; if the current session is not elevated, MAS_AIO.cmd will re-launch itself with the necessary privileges using runas.

How do I activate a specific Windows edition that is not currently installed?

Use the /Z-ID-<ActivationID> switch with the specific GUID of the target edition. This bypasses edition detection and forces activation of that specific ID. You can specify multiple IDs in a single command by repeating the switch with different GUIDs.

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 →