|
|
@ -16,6 +16,10 @@ $office['2019'] = 'if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" |
|
|
|
if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16" |
|
|
|
cscript ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP'; |
|
|
|
|
|
|
|
function loadOsppInfo() { // 初始化ospp信息 |
|
|
|
global $webSite; |
|
|
|
global $osppOption, $osppDescription, $osppDescriptionCn; |
|
|
|
|
|
|
|
$osppOption[] = '/dstatus'; |
|
|
|
$osppDescription[] = 'Displays license information for installed product keys.'; |
|
|
|
$osppDescriptionCn[] = '显示当前已安装产品密钥的许可证信息'; |
|
|
@ -32,7 +36,7 @@ $osppOption[] = '/inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'; |
|
|
|
$osppDescription[] = 'Installs a product key with a user-provided product key.'; |
|
|
|
$osppDescriptionCn[] = '安装产品密钥'; |
|
|
|
|
|
|
|
$osppOption[] = '/sethst:kms.xxx.xx'; |
|
|
|
$osppOption[] = '/sethst:' . $webSite; |
|
|
|
$osppDescription[] = 'Sets a KMS host name with a user-provided host name.'; |
|
|
|
$osppDescriptionCn[] = '设置 KMS 主机名'; |
|
|
|
|
|
|
@ -43,6 +47,7 @@ $osppDescriptionCn[] = '删除 KMS 主机名'; |
|
|
|
$osppOption[] = '/act'; |
|
|
|
$osppDescription[] = 'Activates installed Office product keys.'; |
|
|
|
$osppDescriptionCn[] = '激活 Office'; |
|
|
|
} |
|
|
|
|
|
|
|
function loadOfficeCmd() { // 初始化Office激活命令 |
|
|
|
global $webSite, $office; |
|
|
@ -54,6 +59,7 @@ function loadOfficeCmd() { // 初始化Office激活命令 |
|
|
|
} |
|
|
|
|
|
|
|
function showOfficeHelp() { // 命令行输出Office激活帮助 |
|
|
|
loadOsppInfo(); |
|
|
|
loadOfficeCmd(); |
|
|
|
global $office, $osppOption, $osppDescription, $osppDescriptionCn; |
|
|
|
foreach ($office as $index => $officeKmsCmd) { |
|
|
@ -84,6 +90,7 @@ function showOfficeHelp() { // 命令行输出Office激活帮助 |
|
|
|
} |
|
|
|
|
|
|
|
function webOfficeHelp() { // 网页输出Office激活帮助 |
|
|
|
loadOsppInfo(); |
|
|
|
loadOfficeCmd(); |
|
|
|
global $office, $osppOption, $osppDescription, $osppDescriptionCn; |
|
|
|
echo '<!DOCTYPE html><html><head><meta charset="utf-8">'; |
|
|
|