原理是增加WinRE分区大小

参考https://support.microsoft.com/zh-cn/topic/kb5028997-%E6%89%8B%E5%8A%A8%E8%B0%83%E6%95%B4%E5%88%86%E5%8C%BA%E5%A4%A7%E5%B0%8F%E4%BB%A5%E5%AE%89%E8%A3%85-winre-%E6%9B%B4%E6%96%B0%E7%9A%84%E8%AF%B4%E6%98%8E-400faa27-9343-461c-ada9-24c8229763bf

脚本应以管理员身份运行,内容如下

1
2
3
4
5
6
cd /d "%~dp0"
reagentc /disable
diskpart /s diskpart_script.txt > diskpart_log.txt
reagentc /enable
reagentc /info
pause

diskpart_script.txt内容如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
list disk
REM == 需要修改为安装Windows的磁盘
sel disk 0
list part
REM == 需要修改为OS分区
sel part 3
shrink desired=250 minimum=250
REM == 需要修改为WinRE分区
sel part 4
delete partition override
create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes =0x8000000000000001
format quick fs=ntfs label="Windows RE tools"
list vol