
求助把默認(rèn)PE安裝到容量最大的盤的批處理修改為安裝到系統(tǒng)盤最后由 hfstar 于 -8-30 14:21這個批處理是把PE安裝到容量最大的一個盤,如果我要把PE修改了安裝在系統(tǒng)盤,怎么修改呢?向各位求助一下。
nclick="copycode($('code0'));">復(fù)制代碼
- @echo off
- color 3F
- setlocal EnableDelayedExpansion
- bcdedit /enum {current}|find system32winload.exe>nul
- if %errorlevel% equ 1 (
- set bootmode=uefi
- set winload=winload.efi
- ) else (
- set bootmode=bios
- set winload=winload.exe
- )
- for /f tokens=1-5 delims= %%a in ('drvtype -a ^|find :') do set HDDList=%%d
- for %%b in (!HDDList!) do (
- set tmpVol=%%b
- call :check
- if /i !judge! == ok (
- if /i %bootmode% == uefi (
- if exist !tmpVol!EFIMicrosoftBootBCD set efi=!tmpVol!
- )
- )
- set LastVol=!tmpVol!
- )
- if not !efi!== set LastVol=!efi!
- call :InstPE
- pause & exit
- :check
- for /f tokens=1-4 delims= %%i in ('dir %tmpVol% ^|find /i 可用字節(jié)') do (
- set space=%%k
- )
- set space=!space:,=!
- if !space! lss 50000000 (set judge=err) else set judge=ok
- goto:eof
- :InstPE
- ECHO 安裝PE到 %lastvol% 盤
- if not exist %LastVol%BOOT md %LastVol%BOOT
- copy /y .*.wim %LastVol%BOOT
- copy /y .BOOT.SDI %LastVol%BOOT
- del .*.wim
- bcdedit.exe /timeout 9
- bcdedit.exe /set {current} bootmenupolicy Legacy
- set id1={%time:~6,2%%time:~9,2%ffff-8d96-11de-8e71-fffffffffffa}
- set id2={%time:~6,2%%time:~9,2%ffff-8d96-11de-8e71-fffffffffffb}
- bcdedit /create %id2% /d Windows 10 PE 維護(hù)平臺 /device
- bcdedit /set %id2% ramdisksdidevice partition=%LastVol%
- bcdedit /set %id2% ramdisksdipath bootboot.sdi
- bcdedit /create %id1% /d Windows 10 PE 維護(hù)平臺 /application osloader
- bcdedit /set %id1% device ramdisk=[%LastVol%]boot1064.WIM,%id2%
- bcdedit /set %id1% osdevice ramdisk=[%LastVol%]boot1064.WIM,%id2%
- bcdedit /set %id1% path windowssystem32boot%winload%
- bcdedit /set %id1% description Windows 10 PE 維護(hù)平臺
- bcdedit /set %id1% locale zh-CN
- bcdedit /set %id1% inherit {bootloadersettings}
- bcdedit /set %id1% systemroot windows
- bcdedit /set %id1% detecthal Yes
- bcdedit /set %id1% winpe Yes
- bcdedit /set %id1% ems no
- bcdedit /displayorder %id1% /addlast
- attrib +r +h +s +a %LastVol%BOOT
- goto:eof

