18.为Windows安装Office2021ProPlus

三步操作中的文件需要放置到同一个文件夹
点此下载

1.下载Office Deployment Tool

下载Office Deployment Tool,双击打开释放Steup.exe。点击获取ODT

2.创建配置文件

通过Office部署配置生成网站创建xml配置文件,也可以用现有配置文件
自用配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<Configuration>
<Add OfficeClientEdition="64" Channel="Monthly">
<Product ID="ProPlus2021Retail">
<Language ID="zh-cn" />
<ExcludeApp ID="Access" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
<ExcludeApp ID="OneDrive" />
<ExcludeApp ID="OneNote" />
<ExcludeApp ID="Outlook" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Teams" />
</Product>
</Add>
<Property Name="SharedComputerLicensing" Value="0" />
<Property Name="PinIconsToTaskbar" Value="TRUE" />
<Property Name="SCLCacheOverride" Value="0" />
<Property Name="AUTOACTIVATE" Value="0" />
<Property Name="FORCEAPPSHUTDOWN" Value="FALSE" />
<Property Name="DeviceBasedLicensing" Value="0" />
<Updates Enabled="TRUE" />
<RemoveMSI />
<Display Level="Full" AcceptEULA="TRUE" />
</Configuration>

3.创建Bat文件,编码为ANSI

打开bat文件,执行步骤12534,安装的不是零售版本则无需步骤5。
set kmsserver=192.168.100.220 为我个人搭建的内网kms服务器。不适用于除我以外的任何人
使用时记得将192.168.100.220替换为自己的kms服务器,或替换为网络上的kms服务器。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%1 start "" mshta vbscript:CreateObject("Shell.Application").ShellExecute("%~s0","::","%~dp0","runas",1)(window.close)&&exit

@echo off
set kmsserver=192.168.100.220
title Office下载安装
:start
cls
echo 1.下载 Office
echo 2.安装 Office
echo 3.激活 Office2021ProPlus 版
echo 4.查询 Office 激活
echo 5.安装 VOL 许可证
choice /C 12345 /N /M "请选择操作:"
set input=%errorlevel%
if "%input%"=="1" goto 1
if "%input%"=="2" goto 2
if "%input%"=="3" goto 3
if "%input%"=="4" goto 4
if "%input%"=="5" goto 5
if not defined "%input%" goto start

:1
cd /d %~dp0
echo ----------------
echo 开始时间:%TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo 正在下载……
setup.exe /download "configuration-2021.xml"
echo 完成时间:%TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo 下载完成
echo ----------------
pause
goto start

:2
cd /d %~dp0
echo ----------------
echo 开始时间:%TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo 正在安装……
setup.exe /configure "configuration-2021.xml"
ping /n 5 127.0.0.1 >nul
taskkill /F /IM OfficeC2RClient.exe
echo 完成时间:%TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2%
echo 安装完成
echo ----------------
pause
goto start

:3
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /inpkey:FXYTK-NJJ8C-GB6DW-3DYQT-6F7TH
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /sethst:%kmsserver%
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /act
pause
goto start

:4
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /dstatus
pause
goto start

:5
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /inslic:"%PROGRAMFILES%\Microsoft Office\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ppd.xrm-ms"
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /inslic:"%PROGRAMFILES%\Microsoft Office\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ul.xrm-ms"
cscript "%PROGRAMFILES%\Microsoft Office\Office16\OSPP.vbs" /inslic:"%PROGRAMFILES%\Microsoft Office\root\Licenses16\ProPlus2021VL_KMS_Client_AE-ul-oob.xrm-ms"
pause
goto start
  • Copyrights © 2023-2024 kukusun