@echo off
if exist boot.new del boot.new
if not exist boot.ini goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find/i "/fastdetect">nul && echo %%l /kernel=kernel.exe||echo %%l
)>>boot.new
attrib -s -h -r boot.ini
copy boot.new boot.ini>nul
attrib +s +h +r boot.ini
======================================================
:: ModBoot.cmd - V3 - Modify of boot.ini
:: Richard Song - 2006-6-11 - CMD@WinXP
@echo off
if not exist boot.ini echo Not found boot.ini!&goto :eof
if exist %temp%\boot.new del /f /a %temp%\boot.new
find/i "/kernel=" boot.ini>nul && echo Modified boot.ini! && goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find/i "/fastdetect" >nul && echo %%l /kernel=kernel.exe || echo %%l
)>>%temp%\boot.new
find/i "/kernel" %temp%\boot.new>nul 2>nul
if errorlevel 1 echo Fail to parse boot.ini!&goto :eof
attrib -s -h -r boot.ini
copy boot.ini %temp%\boot.bak>nul&&echo Pass to backup boot.ini.
copy %temp%\boot.new boot.ini>nul 2>nul
find/i "/kernel" boot.ini>nul 2>nul
if not errorlevel 1 echo Pass to wrtie boot.ini.
if errorlevel 1 copy %temp%\boot.bak boot.ini>nul & echo Fail to wrtie boot.ini!
attrib +s +h +r boot.ini
del %temp%\boot.new & del %temp%\boot.bak
if exist boot.new del boot.new
if not exist boot.ini goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find/i "/fastdetect">nul && echo %%l /kernel=kernel.exe||echo %%l
)>>boot.new
attrib -s -h -r boot.ini
copy boot.new boot.ini>nul
attrib +s +h +r boot.ini
======================================================
:: ModBoot.cmd - V3 - Modify of boot.ini
:: Richard Song - 2006-6-11 - CMD@WinXP
@echo off
if not exist boot.ini echo Not found boot.ini!&goto :eof
if exist %temp%\boot.new del /f /a %temp%\boot.new
find/i "/kernel=" boot.ini>nul && echo Modified boot.ini! && goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find/i "/fastdetect" >nul && echo %%l /kernel=kernel.exe || echo %%l
)>>%temp%\boot.new
find/i "/kernel" %temp%\boot.new>nul 2>nul
if errorlevel 1 echo Fail to parse boot.ini!&goto :eof
attrib -s -h -r boot.ini
copy boot.ini %temp%\boot.bak>nul&&echo Pass to backup boot.ini.
copy %temp%\boot.new boot.ini>nul 2>nul
find/i "/kernel" boot.ini>nul 2>nul
if not errorlevel 1 echo Pass to wrtie boot.ini.
if errorlevel 1 copy %temp%\boot.bak boot.ini>nul & echo Fail to wrtie boot.ini!
attrib +s +h +r boot.ini
del %temp%\boot.new & del %temp%\boot.bak