Troubleshoot.cmd (also accessible as menu option [8] inside MAS_AIO.cmd) provides a menu-driven repair interface for diagnosing and fixing activation-related issues. It targets system file corruption, WMI failures, licensing token corruption, and registry permission errors that prevent activation from succeeding.
The script does not activate Windows or Office itself. Use it to resolve underlying system issues before or after running an activation method (see page 2).
For checking current activation status without making changes, see page 3.1. For changing Windows editions after troubleshooting, see page 3.3. </old_str> <new_str>
Troubleshoot.cmd (also accessible as menu option [8] inside MAS_AIO.cmd) provides a menu-driven repair interface for diagnosing and fixing activation-related issues. It targets system file corruption, WMI failures, licensing token corruption, and registry permission errors that prevent activation from succeeding.
The script does not activate Windows or Office itself. Use it to resolve underlying system issues before or after running an activation method (see page 2).
For checking current activation status without making changes, see page 3.1. For changing Windows editions after troubleshooting, see page 3.3.
The troubleshooting system is built around a menu-driven interface (at_menu) that dispatches to individual repair subroutines.
Menu structure and internal dispatch (Troubleshoot.cmd)
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd390-428 MAS/Separate-Files-Version/Troubleshoot.cmd562-741 MAS/Separate-Files-Version/Troubleshoot.cmd1097-1215
| Option | Menu Label | Internal Label | Supported OS |
|---|---|---|---|
| [1] | Help | Opens URLs | All |
| [2] | DISM RestoreHealth | dism_rest | Windows 8+ (build ≥ 9200) |
| [3] | SFC Scannow | sfcscan | All |
| [4] | Fix WMI | fixwmi | All (aborts on Server) |
| [5] | Fix Licensing | retokens | Vista SP2+ (build ≥ 6002) |
| [6] | Fix WPA Registry | Opens URL | All |
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd390-428 MAS/Separate-Files-Version/Troubleshoot.cmd435-442 MAS/Separate-Files-Version/Troubleshoot.cmd572-577 MAS/Separate-Files-Version/Troubleshoot.cmd1103-1109
| Symptom | Recommended Option(s) |
|---|---|
Activation scripts report missing system files (sppsvc.exe, ClipUp.exe) | [2] DISM → [3] SFC → restart |
| WMI queries hang or return errors during activation | [4] Fix WMI |
sppsvc fails to start (error 1053) | Restart, then [5] Fix Licensing |
| Activation fails after DISM/SFC with no clear error | [5] Fix Licensing |
| ClipSVC or licensing token corruption after HWID attempt | [5] Fix Licensing |
SPP registry (HKLM\SYSTEM\WPA) is misconfigured | [6] Fix WPA Registry (follow external guide) |
| Office activation fails after Windows repair | [5] Fix Licensing (includes Office repair) |
For persistent activation failures with no obvious single cause, run options in this order:
Running DISM before SFC ensures SFC has a good source to restore files from. Fix Licensing should be applied last because it deactivates Windows and Office, requiring reactivation afterward.
The script performs environment validation before presenting at_menu. This follows the same startup pattern used by all MAS scripts (see page 5.2).
Pre-menu startup flow
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd17-262 MAS/Separate-Files-Version/Troubleshoot.cmd1686-1736
retokens)The retokens subroutine is the most comprehensive repair option. It sequentially rebuilds ClipSVC licenses, SPP tokens, OSPP tokens, and triggers Office repair. It deactivates Windows and Office as a side effect; digitally licensed or OEM-activated Windows will reactivate automatically.
Important: This option skips ClipSVC cleanup if Windows is already permanently activated, if the internet is unavailable, or if licensing servers cannot be reached — to avoid unnecessary deactivation.
cleanlicensing)Sources: MAS/Separate-Files-Version/Troubleshoot.cmd603-742 MAS/Separate-Files-Version/Troubleshoot.cmd1579-1601
rebuildspptok)Sources: MAS/Separate-Files-Version/Troubleshoot.cmd747-888 MAS/Separate-Files-Version/Troubleshoot.cmd1343-1390 MAS/Separate-Files-Version/Troubleshoot.cmd1494-1517
repairoffice)After rebuilding SPP tokens, retokens runs OSPP token rebuilding (scandatospp) and then invokes the Office setup repair mechanism for each installed Office version. For non-C2R Office 2010–2016, a new window opens asking the user to select Quick Repair.
| Office Version | Detection Registry | Repair Executable |
|---|---|---|
| MSI 14.0 x86 | HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot | setup.exe (via getrepairsetup) |
| MSI 14.0 x64 | HKLM\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot | setup.exe |
| MSI 15.0 x86/x64 | Same pattern with 15.0 | setup.exe |
| MSI 16.0 x86/x64 | Same pattern with 16.0 | setup.exe |
| C2R 15.0 | HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun | integratedoffice.exe REPAIRUI RERUNMODE |
| C2R 16.0 | HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration | OfficeClickToRun.exe Scenario=Repair RepairType=QuickRepair |
| UWP 16.0 | AppX package Microsoft.Office.Desktop | Skipped |
| C2R 14.0 | HKLM\...\Office\14.0\CVH | Skipped |
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd949-1068 MAS/Separate-Files-Version/Troubleshoot.cmd1070-1093
Both DISM and SFC save logs to Desktop\AT_Logs\ as .cab archives (via compresslog) for post-repair review. The TrustedInstaller service is stopped before each run to allow CBS log rotation.
dism_rest)Runs dism /english /online /cleanup-image /restorehealth. This contacts Windows Update to download replacement files for corrupted components. Internet connection and working Windows Update are required.
Only supported on Windows 8 and later (build ≥ 9200). The script checks internet connectivity and warns if it is unavailable before proceeding.
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd432-508
sfcscan)Runs sfc /scannow. Repairs individual system files using the component store. Run DISM first so SFC has a healthy source to restore from. May need to be run up to three times with restarts to fully resolve issues.
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd512-559
fixwmi)Rebuilds the WMI repository when Winmgmt is not responding. Not supported on Windows Server (aborted by design to avoid breaking server WMI). The checkwmi helper validates WMI by querying Win32_ComputerSystem and SoftwareLicensingService via winmgmt /verifyrepository.
Fix WMI repair flow
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd1097-1251
checkperms / fixsppperms)checkperms validates that NT SERVICE\sppsvc has the required ACL entries on three targets. If any check fails, fixsppperms (an embedded PowerShell block in the :fixsppperms: section) applies the fix. Incorrect permissions are commonly set by gaming spoofers or third-party tools.
| Check Target | Required Permission | Error Variable |
|---|---|---|
%tokenstore% (SPP token folder) | NT SERVICE\sppsvc FullControl | Error Found In Token Folder |
HKLM:\SYSTEM\WPA | NT SERVICE\sppsvc QueryValues, EnumerateSubKeys, WriteKey | Error Found In SPP Registries |
HKLM:\SOFTWARE\...\SoftwareProtectionPlatform | NT SERVICE\sppsvc SetValue | Error Found In SPP Registries |
HKU\S-1-5-20\...\SoftwareProtectionPlatform | Network Service FullControl | Error Found In S-1-5-20 SPP |
The fixsppperms PowerShell block uses Set-Acl for folder and registry ACL fixes, and the Take-Permissions function (from a StackOverflow-sourced pattern) to take ownership of the S-1-5-20 SPP registry key before applying permissions.
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd1303-1337 MAS/Separate-Files-Version/Troubleshoot.cmd1396-1490
scandat / scandatospp)scandat and scandatospp are utility subroutines called with either check or delete as a parameter. check sets the %token% variable to the path of a found tokens.dat; delete removes all *.dat files in the target directories using attrib -r -s -h followed by del /S /F /Q.
SPP token search paths (scandat)
| Path |
|---|
%SysPath%\spp\store_test\2.0\ |
%SysPath%\spp\store\ |
%SysPath%\spp\store\2.0\ |
%SystemDrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareProtectionPlatform\ |
%SystemDrive%\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\ |
OSPP token search path (scandatospp)
| Path |
|---|
%ProgramData%\Microsoft\OfficeSoftwareProtectionPlatform\ |
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd1521-1567
Troubleshoot.cmd uses the same split-on-delimiter technique as other MAS scripts to embed inline PowerShell. Each block is delimited by a matching pair of labels (e.g., :xrm: ... :xrm:) and invoked with [System.IO.File]::ReadAllText + -split.
| Delimiter | Called From | Purpose |
|---|---|---|
:xrm: | rebuildspptok | InstallLicenseFile, ReinstallLicenses — reinstall *.xrm-ms license files via SoftwareLicensingService WMI |
:fixsppperms: | rebuildspptok (via checkperms) | Fix SPP token folder and registry ACLs using Set-Acl |
:regown: | cleanlicensing (via regownstart) | Take ownership of the volatile ClipSVC\Volatile\PersistedSystemState registry key using RtlAdjustPrivilege P/Invoke |
:regdel: | rebuildspptok | Remove legacy KMS38 protection ACL from SPP registry (backward compatibility only) |
:pstst | Startup | PowerShell LanguageMode check (shared with all MAS scripts) |
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd1494-1517 MAS/Separate-Files-Version/Troubleshoot.cmd1396-1490 MAS/Separate-Files-Version/Troubleshoot.cmd1579-1601 MAS/Separate-Files-Version/Troubleshoot.cmd1610-1631 MAS/Separate-Files-Version/Troubleshoot.cmd218-220
The system provides comprehensive logging and error reporting:
Sources: MAS/Separate-Files-Version/Troubleshoot.cmd1187-1215 MAS/Separate-Files-Version/Troubleshoot.cmd467-480
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.