不知道谁分享给我的,可能是 chxm1023 ?

不管了,分享出来给大家学习:

@echo off
@color 2f
if not exist %systemdrive%\boot.ini goto un_bcd
type %systemdrive%\boot.ini>%systemdrive%\boot.bak
attrib -h -r -s %systemdrive%\boot.ini
type %systemdrive%\boot.bak|find "优元素PE启动盘" /i /v>%systemdrive%\boot.ini
attrib +s +r +h %systemdrive%\boot.ini
goto end

:un_bcd
set vid=
set timeout=5
set gname=优元素PE启动盘
set gname2=\chxm
type temp_bcd.txt | find "%gname2%" >nul && goto un_bcd_1
bcdedit  /create /d "%gname%" /application bootsector >vid.ini

:un_bcd_1
for /f "tokens=1 delims=:" %%i In ('findstr /n %gname2%  temp_bcd.txt') Do (
                 Set nid=%%i
)
set /a nid=%nid%-3
for /f "skip=%nid% tokens=2" %%i in (temp_bcd.txt) do set vid=%%i&goto un_bcd_2

:un_bcd_2
bcdedit /delete %vid% /cleanup >nul
bcdedit /timeout   %timeout% >nul
bcdedit >temp_bcd.txt
type temp_bcd.txt | find "%gname2%" >nul && goto un_bcd_1
goto end

:end
del temp_bcd.txt >nul 2>nul
del vid.ini >nul 2>nul
Exit
收藏
分享
我的博客:cboot.org
最新回复 (0)
返回