Installing Microsoft Office via Winget with Custom XML Configuration

Overview

This document explains how to install Microsoft Office using Winget while maintaining control over installation settings through an existing Office Deployment Tool (ODT) configuration XML file. It includes the available Winget flags, usage examples, and implementation within a .cmd script.

1. Introduction

Traditionally, organizations install Microsoft Office using PowerShell or CMD scripts that invoke the Office Deployment Tool (setup.exe) with a configuration XML file defining which applications and languages to include or exclude.

Winget can now perform the same installation while still supporting XML-based configuration.

2. Relevant Winget Command

winget install --id Microsoft.Office

3. Useful Winget Flags

Flag Description


-e, --exact Requires an exact package match. --scope machine Installs Office for all users. -h, --silent Runs the installer without user interaction. --accept-package-agreements Accepts package license terms. --override Replaces installer default arguments.

4. Using an XML Configuration File

winget install --id Microsoft.Office --override "/configure C:\Path\To\Configuration.xml"

5. Example .cmd Script

@echo off
setlocal
set "OFFICE_CFG=\\fileserver\software\Office\Configuration.xml"
winget install --id Microsoft.Office -e -h --scope machine --accept-package-agreements --override "/configure "%OFFICE_CFG%""
endlocal

6. Alternate Approach

You can install the Office Deployment Tool via Winget and then run setup.exe /configure <xml> manually.

7. Tips

  • Keep XML updated with correct apps and languages.
  • Use --disable-interactivity for silent installs.
  • Use --log to track installation.

8. Summary

Winget simplifies deployment of Microsoft Office while still supporting detailed XML configuration management.


Powered by Nextra