|
本帖最后由 mr8246 于 2024-9-18 08:31 编辑
今天用lightning大神的PE系统,及论坛里另一位大神2011hiboy的bcdedit添加wim代码,弄了个一键恢复的脚本
D:\boot文件夹下包含boot_re.wim,boot_re.bat,boot.sdi,一键还原.bat,002.wim(备份的镜像)
在Windows下点击一键还原.bat,就重启进入PE开始还原了
PECMD.ini脚本(boot_re.wim)
DISK ,,,1,U:,0x6
EXEC d:\boot\boot_re.bat
一键还原.bat脚本
@echo off
bcdedit /timeout 2
for /f "delims={,} tokens=2" %%a in ('bcdedit /create /d "PE" -application osloader') do set Guid={%%a}
bcdedit /set %Guid% device ramdisk="[d:]\boot\boot_re.wim,{ramdiskoptions}"
bcdedit /set %Guid% osdevice ramdisk="[d:]\boot\boot_re.wim,{ramdiskoptions}"
bcdedit /set %Guid% path \windows\system32\boot\winload.exe
bcdedit /set %Guid% locale zh-CN
bcdedit /set %Guid% systemroot \windows
bcdedit /set %Guid% bootmenupolicy Legacy
bcdedit /set %Guid% detecthal Yes
bcdedit /set %Guid% winpe Yes
bcdedit /default %Guid%
bcdedit /displayorder %Guid% -addlast
bcdedit /create {ramdiskoptions}
bcdedit /set {ramdiskoptions} ramdisksdidevice partition=d:
bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
echo @echo off>boot_re.bat
echo format c: /q /u /y>>boot_re.bat
echo Dism /Apply-Image /ImageFile:d:\boot\002.wim /Index:1 /ApplyDir:C:>>boot_re.bat
echo shutdown -r -t 0 >>boot_re.bat
shutdown -r -t 0
|
|