@ECHO OFF
TITLE office 全版本系统激活
@echo off
for /l %%a in (8,1,16) do (
for /f "tokens=*" %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Office\%%a.0\Word\Options" /v "PROGRAMDIR"') do (if not "%%i"=="" set Ever=%%a))
cls
if exist "%ProgramFiles%\Microsoft Office\Office%Ever%\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office%Ever%"
if exist "%ProgramFiles(x86)%\Microsoft Office\Office%Ever%\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office%Ever%"\
cscript ospp.vbs /sethst:10.1.1.12
cscript ospp.vbs /act
cscript ospp.vbs /dstatus
pause
新建文本文档将上面的代码复制过去保存为office全系列激活脚本-改良版.cmd