A lightweight, user-friendly PowerShell and Batch script toolkit for automating Microsoft Office LTSC deployments across multiple institutions. Streamline your institutional software deployments with minimal configuration.
- One-click deployment: Execute a single batch file to launch Office installation
- Multi-configuration support: Choose from multiple pre-configured XML profiles during installation
- Administrator privilege handling: Automatic UAC prompt management
- Robust error handling: File existence checks, exit code validation, and graceful error messaging
- UTF-8 multilingual support: Full support for Chinese, English, and other languages
- No external dependencies: Works with Windows native tools and Office Deployment Tool
Install_Launcher.bat- Entry point that elevates to administrator and launches the PowerShell installerInstall_Office.bat- Simplified single-config alternative for fixed deploymentsOffice_Installer.ps1- Multi-config selector with menu-driven installation UI- Configuration templates for various institution setups
-
Windows 10/11 or Windows Server 2016+
-
PowerShell 5.0 or later (built-in on Windows 10+)
-
Office LTSC ODT (Office Deployment Tool)
- Download from: Microsoft Office Deployment Tool
- Extract
setup.exeinto the same directory as these scripts
-
Configuration XML file(s)
- Use the provided templates or create your own
- Place in the same directory as the scripts
-
Create a folder for your deployment:
mkdir Office-Deployment cd Office-Deployment -
Place these files in the folder:
Install_Launcher.batOffice_Installer.ps1setup.exe(from ODT extraction)- Your
*.xmlconfiguration files
-
Double-click
Install_Launcher.bat- Click "Yes" when UAC prompt appears
- Select your configuration from the menu
- Wait for installation to complete
-
Place these files in the same directory:
Install_Office.batsetup.exe(from ODT extraction)- Your XML configuration file (update the filename in the
.batscript)
-
Double-click
Install_Office.bat- Click "Yes" when UAC prompt appears
- Installation will proceed automatically
Purpose: Entry point for multi-configuration deployments
Usage: Install_Launcher.bat
Features:
- Elevates to administrator privileges via PowerShell
- Launches the interactive menu system
- Validates script file existence before proceeding
Purpose: Simplified single-configuration deployment
Usage: Install_Office.bat
Features:
- Direct setup.exe execution with
/configureparameter - Minimal configuration (edit
XML_FILEvariable before use) - Best for standardized institutional deployments
Note: Modify line 2 with your actual XML filename:
SET "XML_FILE=YourConfigFile.xml"Purpose: Interactive configuration selector with menu UI
Usage: Automatically launched by Install_Launcher.bat
Features:
- Display available configurations with file existence validation
- Menu-driven selection (0-2 options)
- Real-time configuration file validation
- Clear error messages for missing files
- Automatic exit code reporting
Configuration definition (lines 11-20):
$Configs = @{
"1" = @{
Name = "Your Config Name"
File = "your-config-file.xml"
}
"2" = @{
Name = "Another Config"
File = "another-config.xml"
}
}This repository now includes a universal batch script (AutoActivate.bat) designed to automate the KMS client configuration for Office LTSC.
- Smart Path Detection: Automatically scans all common installation paths (C2R & MSI) to locate
ospp.vbs. - Auto-Elevation: Automatically requests Administrator privileges if run as a standard user.
- Universal Support: Compatible with Office 2016, 2019, 2021, and 2024 LTSC.
- Complete the Office installation.
- Run
AutoActivate.bat. - The script will detect your Office version, set the KMS host, and apply the activation command automatically.
| Component | Requirement |
|---|---|
| OS | Windows 10 (1909+) or Windows Server 2016+ |
| PowerShell | 5.0 or later |
| Administrator Access | Required (automatic UAC elevation) |
| Disk Space | ~3 GB for Office LTSC 2024 |
| Internet Connection | Not required (local installation) |
The Office Deployment Tool uses XML configuration files to control installation options. Key parameters:
<Configuration ID="INSTITUTION_NAME">
<!-- Language and product selection -->
<Add OfficeClientEdition="64" Channel="PerpetualVL2024">
<Product ID="ProPlus2024Volume">
<Language ID="zh-cn" /> <!-- Simplified Chinese -->
<Language ID="en-us" /> <!-- English -->
</Product>
</Add>
<!-- Installation settings -->
<Property Name="FORCEAPPSHUTDOWN" Value="FALSE" />
<Property Name="SharedComputerLicensing" Value="0" />
<!-- Customization options -->
<Updates Enabled="TRUE" />
<RemoveMSI />
<AppSettings>
<User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" />
</AppSettings>
</Configuration>For detailed XML reference, see: Microsoft Office Deployment Tool Configuration Reference
<Product ID="ProPlus2024Volume">
<Language ID="zh-cn" /> <!-- Simplified Chinese -->
<Language ID="zh-tw" /> <!-- Traditional Chinese -->
<Language ID="en-us" /> <!-- English (US) -->
<Language ID="ja-jp" /> <!-- Japanese -->
</Product>Solution: Ensure both Install_Launcher.bat and Office_Installer.ps1 are in the same directory.
# Check file location
Get-ChildItem -Path $PSScriptRootSolution: Download and extract the Office Deployment Tool to the same directory:
- Download ODT from Microsoft
- Extract the contents
- Copy
setup.exeto your deployment folder - Verify with:
Test-Path .\setup.exe
Solution: The .xml file referenced in the script doesn't exist in the script directory.
Check:
Test-Path ".\AEPC_Office2024_MultilangEn_Personal.xml"Fix: Either place the correct XML file or update the configuration reference in Office_Installer.ps1.
Solution: Check PowerShell execution policy:
# Run as Administrator, then:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserThe exit code will be displayed. Common codes:
| Exit Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Invalid configuration file |
| 2 | setup.exe not found |
| 3 | Product ID not recognized |
| 17025 | Another Office installation in progress |
Solution: Review the XML configuration or check if another installation is running.
Possible causes:
- Network connectivity issues (if downloading components)
- Antivirus software interference
- Insufficient disk space
- Another Office installation process running
Solution:
# Check for other Office installations
Get-Process | findstr -i "setup"
# Review installation logs
Get-Content "$env:APPDATA\Microsoft\Office\[version]\logging\*"Use Install_Launcher.bat with multiple XML configurations:
- Configuration 1: AEPC (Multilingual + Professional Plus)
- Configuration 2: ARTVU (Simplified Chinese + Standard)
- Configuration 3: Research Lab (English Only + Developer Tools)
Use Install_Office.bat with a single configuration for consistency across all workstations.
Extend the PowerShell script for batch deployment across multiple machines:
$Computers = @("PC001", "PC002", "PC003")
foreach ($Computer in $Computers) {
Invoke-Command -ComputerName $Computer -ScriptBlock {
& "\\SharedPath\Office_Installer.ps1"
}
}Contributions are welcome! If you'd like to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Make your changes and test thoroughly
- Commit with clear messages
- Push to the branch and open a Pull Request
Please ensure your contributions:
- Follow the existing code style
- Include comments for complex logic
- Test with multiple Office versions and configurations
- Update documentation accordingly
This project is licensed under the MIT License - see the LICENSE file for details.
- Microsoft Office Deployment Tool documentation
- Windows PowerShell community best practices
- Feedback from institutional IT teams
Q: Can I use this with Office 365 (Microsoft 365)? A: Yes, this toolkit is not only specifically designed for Office LTSC (volume licensing perpetual version), but also Microsoft 365 can use it as a kind of deployment method.
Q: Does this work with Office 2019 or earlier versions? A: Yes, these scripts are optimized for Office LTSC. Earlier versions may have different XML schemas, you can generate your XML with Office Customization Tool.
Q: Can I schedule installations for off-hours?
A: Yes, you can create a scheduled task that runs Install_Office.bat or the PowerShell script at a specific time using Windows Task Scheduler.
Q: Is network connectivity required? A: Not if all Office components are pre-downloaded. However, initial setup and language pack downloads may require internet access.
Q: How do I uninstall Office? A: Use the standard Windows Control Panel β Programs and Features β Uninstall. This toolkit only handles installation.
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check the Troubleshooting section above
- Review Microsoft's Office Deployment Tool documentation
Last Updated: November 2025 Version: 1.0 Author: Office Deployment Toolkit Contributors