|
用命令给BCD增加一个WIM启动项的技术问题
-------------------------------------------------------------------------------------
经测试,拷贝启动项后,只需下面三个设置命令就可以正常加载引导ESP盘上的boot.wim:
bcdedit -set {d355b3ab-ad8c-11ec-b338-b3781ffaf120} device ramdisk="[boot]\boot.wim,{ramdiskoptions}"
bcdedit -set {d355b3ab-ad8c-11ec-b338-b3781ffaf120} path \Windows\system32\boot\winload.efi
bcdedit -set {d355b3ab-ad8c-11ec-b338-b3781ffaf120} winpe yes
-------------------------------------------------------------------------------------
目的:
现在已获取ID了,如果简单获取ESP分区编号并挂载为 Z:盘 ,然后复制boot.wim等文件到 Z:盘
下面是论坛 lintrainwy 坛友发的挂载命令:
原帖地址:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=385400
echo 正在挂载系统分区……
FOR /F "usebackq tokens=2 delims= " %%i in (` echo list disk ^|diskpart ^| find "磁盘" `) do (
echo select disk=%%i>%temp%\t.txt
echo list partition>>%temp%\t.txt
FOR /F "usebackq tokens=2 delims= " %%j in (` diskpart /s %temp%\t.txt ^| find "系统" `) do (
echo select disk=%%i>%temp%\t.txt
echo select partition=%%j>>%temp%\t.txt
echo assign>>%temp%\t.txt
diskpart /s %temp%\t.txt>nul
) )
感觉比较复杂,有点难理解,不知道有没更简单的方法?
|
|