Bem, boot.ini é um arquivo de sistema. Antes de modificar isso, você deve remover esse atributo.
Leia e tente minha solução. Ele procura por todas as opções de inicialização do Windows que a pasta é denominada WINDOWS (todas as maiúsculas) no boot.ini. Em seguida, ele recria boot.ini de acordo com sua escolha - para adicionar ou remover "/ bootlogo / noguiboot" - para cada opção de inicialização do Windows.
@echo off
SETLOCAL EnableDelayedExpansion
echo.This batch is an editor for all Windows boot options in boot.ini.
echo.- Limitations: works only with 8 parameters and detects only Windows instalations with folders named "WINDOWS" - all uppercased
echo.
::save the current path
set pathbak=%cd%
for /f "tokens=1* delims=:" %%a in ("%pathbak%") do (
set drvbak=%%a
)
::put bellow the drive where boot.ini is
c:
cd \
::remove system and hidden attributes from boot.ini
attrib -r -s -h boot.ini
::create new file
echo.>boot.new
::read boot.ini
for /f "tokens=1* delims=\" %%a in (boot.ini) do (
if "%%b"=="" (
echo.%%a>>boot.new
)
for /f "tokens=1* delims==" %%c in ("%%b") do (
::find Windows boot options
if "%%c" neq "WINDOWS" (
echo.%%a\%%b>>boot.new
) else (
if "%%b"=="WINDOWS" (
echo.%%a\%%b>>boot.new
) else (
::split parameters
for /f "tokens=1,2,3,4,5,6,7,8* delims=/" %%e in ("%%d") do (
::remove spaces after strings
for /f "delims= " %%n in ("%%a") do set __a=%%n
for /f "delims= " %%n in ("%%c") do set __c=%%n
for /f "delims=" %%n in ("%%e") do set __e=%%n
for /f "delims= " %%n in ("%%f") do set __f=%%n
for /f "delims= " %%n in ("%%g") do set __g=%%n
for /f "delims= " %%n in ("%%h") do set __h=%%n
for /f "delims= " %%n in ("%%i") do set __i=%%n
for /f "delims= " %%n in ("%%j") do set __j=%%n
for /f "delims= " %%n in ("%%k") do set __k=%%n
for /f "delims= " %%n in ("%%l") do set __l=%%n
for /f "delims= " %%n in ("%%m") do set __m=%%n
echo.Found a WINDOWS boot option in partition "!__a!":
echo.- text seen on boot: !__e!
if "!__f!" neq "" (
echo.- parameter 1: /!__f!
) else (
echo.- parameter 1:
)
if "!__g!" neq "" (
echo.- parameter 2: /!__g!
) else (
echo.- parameter 2:
)
if "!__h!" neq "" (
echo.- parameter 3: /!__h!
) else (
echo.- parameter 3:
)
if "!__i!" neq "" (
echo.- parameter 4: /!__i!
) else (
echo.- parameter 4:
)
if "!__j!" neq "" (
echo.- parameter 5: /!__j!
) else (
echo.- parameter 5:
)
if "!__k!" neq "" (
echo.- parameter 6: /!__k!
) else (
echo.- parameter 6:
)
if "!__l!" neq "" (
echo.- parameter 7: /!__l!
) else (
echo.- parameter 7:
)
if "!__m!" neq "" (
echo.- parameter 8: /!__m!
) else (
echo.- parameter 8:
)
echo.
set bootlogo=0
if "!__f!"=="bootlogo" set bootlogo=1
if "!__g!"=="bootlogo" set bootlogo=1
if "!__h!"=="bootlogo" set bootlogo=1
if "!__i!"=="bootlogo" set bootlogo=1
if "!__j!"=="bootlogo" set bootlogo=1
if "!__k!"=="bootlogo" set bootlogo=1
if "!__l!"=="bootlogo" set bootlogo=1
if "!__m!"=="bootlogo" set bootlogo=1
set noguiboot=0
if "!__f!"=="noguiboot" set noguiboot=1
if "!__g!"=="noguiboot" set noguiboot=1
if "!__h!"=="noguiboot" set noguiboot=1
if "!__i!"=="noguiboot" set noguiboot=1
if "!__j!"=="noguiboot" set noguiboot=1
if "!__k!"=="noguiboot" set noguiboot=1
if "!__l!"=="noguiboot" set noguiboot=1
if "!__m!"=="noguiboot" set noguiboot=1
set /a bootlogonoguiboot=!bootlogo!+!noguiboot!
if "!bootlogonoguiboot!"=="2" (
echo.Do you want to remove /bootlogo /noguiboot parameters for that Windows boot option [y or n]?
set /p choice1=
if "!choice1!"=="y" (
set newoption=!__a!\!__c!=!__e!
if "!__f!" neq "" if "!__f!" neq "bootlogo" if "!__f!" neq "noguiboot" set newoption=!newoption! /!__f!
if "!__g!" neq "" if "!__g!" neq "bootlogo" if "!__g!" neq "noguiboot" set newoption=!newoption! /!__g!
if "!__h!" neq "" if "!__h!" neq "bootlogo" if "!__h!" neq "noguiboot" set newoption=!newoption! /!__h!
if "!__i!" neq "" if "!__i!" neq "bootlogo" if "!__i!" neq "noguiboot" set newoption=!newoption! /!__i!
if "!__j!" neq "" if "!__j!" neq "bootlogo" if "!__j!" neq "noguiboot" set newoption=!newoption! /!__j!
if "!__k!" neq "" if "!__k!" neq "bootlogo" if "!__k!" neq "noguiboot" set newoption=!newoption! /!__k!
if "!__l!" neq "" if "!__l!" neq "bootlogo" if "!__l!" neq "noguiboot" set newoption=!newoption! /!__l!
if "!__m!" neq "" if "!__m!" neq "bootlogo" if "!__m!" neq "noguiboot" set newoption=!newoption! /!__m!
echo.!newoption!>>boot.new
) else (
echo.%%a\%%b>>boot.new
)
set choice1=
) else (
if "!bootlogonoguiboot!" neq "2" echo.Do you want to add /bootlogo /noguiboot parameters for that Windows boot option [y or n]?
(
set /p choice1=
if "!choice1!"=="y" (
set newoption=!__a!\!__c!=!__e!
if "!__f!" neq "" if "!__f!" neq "bootlogo" if "!__f!" neq "noguiboot" set newoption=!newoption! /!__f!
if "!__g!" neq "" if "!__g!" neq "bootlogo" if "!__g!" neq "noguiboot" set newoption=!newoption! /!__g!
if "!__h!" neq "" if "!__h!" neq "bootlogo" if "!__h!" neq "noguiboot" set newoption=!newoption! /!__h!
if "!__i!" neq "" if "!__i!" neq "bootlogo" if "!__i!" neq "noguiboot" set newoption=!newoption! /!__i!
if "!__j!" neq "" if "!__j!" neq "bootlogo" if "!__j!" neq "noguiboot" set newoption=!newoption! /!__j!
if "!__k!" neq "" if "!__k!" neq "bootlogo" if "!__k!" neq "noguiboot" set newoption=!newoption! /!__k!
if "!__l!" neq "" if "!__l!" neq "bootlogo" if "!__l!" neq "noguiboot" set newoption=!newoption! /!__l!
if "!__m!" neq "" if "!__m!" neq "bootlogo" if "!__m!" neq "noguiboot" set newoption=!newoption! /!__m!
set newoption=!newoption! /bootlogo /noguiboot
echo.!newoption!>>boot.new
) else (
echo.%%a\%%b>>boot.new
)
set choice1=
)
)
)
)
)
)
)
cls
echo......................
type boot.new
echo......................
::replace current boot.ini
copy boot.ini boot.bak.%random%
copy boot.new boot.ini
::restore system and hidden attributes
attrib +r +s +h boot.ini
::restore previous path
%drvbak%:
cd %pathbak%