|
这是我以前在用的,你试试
@echo off
rem 将启动设置备份到D盘 “VistaBCD” 目录下
md D:\VistaBCD
attrib D:\VistaBCD +h +s
bcdedit /export "D:\VistaBCD\BcdPE"
attrib c:\boot.* -r -s -h
del /f c:\boot.*
COLOR f9
set vid=
set timeout=5
set gname=一个人WinPE系统
set gname2=\ygren.mbr
TITLE 设置一个人 WinPE 系统的Vista引导
bcdedit >temp_bcd.txt
type temp_bcd.txt | find "Windows Boot Manager" >nul && goto bcd_1
goto exit
:bcd_1
bcdedit >temp_bcd.txt
type temp_bcd.txt | find "%gname2%" >nul && goto un_bcd_1
bcdedit /create /d "%gname%" /application bootsector >%windir%\pevid.ini
for,/f,"tokens=2 delims={",%%i,In (%windir%\pevid.ini) Do (
set vida=%%i
)
for,/f,"tokens=1 delims=}",%%i,In ("%vida%") Do (
set vid={%%i}
)
echo %vid%>%windir%\pevid.ini
bcdedit /set %vid% device partition=%systemdrive% >nul
bcdedit /set %vid% path %gname2% >nul
bcdedit /displayorder %vid% /addlast >nul
bcdedit /timeout %timeout% >nul
goto exit
:un_bcd_1
for,/f,"tokens=1",%%i,In (%windir%\pevid.ini) Do (
set vid=%%i
)
bcdedit /delete %vid% /cleanup >nul
del %windir%\pevid.ini
goto bcd_1
:exit
del /f temp_bcd.txt
cd \
del /f /q /s boot.ini
del /f VistaBootPE.cmd |
|