Boot.ini'ye toplu işlem seçeneği ekleyin


1

Bir boot.ini dosyasındaki son satıra metin ekleyen bir toplu iş dosyası oluşturmam gerekiyor, örneğin boot.ini dosyamın son satırı:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect

/ bootlogo / noguiboot seçeneği eklemeliyim, bu yüzden boot.ini satırı şu şekilde değiştirilmelidir:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /bootlogo /noguiboot

Bir toplu iş dosyası ile bunu yapabilir miyim? Bunu yapmanın başka bir yolu var mı?

Teşekkürler.

Yanıtlar:


0

Sorunuzu anlıyor muyum bilmiyorum ama bir satır eklemek oldukça kolaydır:

yankı "blabla" >> c: \ boot.ini


no, echo "blabla" >> c: \ boot.ini ile dosyanın sonraki satırına metin ekleyin, dosyanın son satırına metin
eklemeliyim

0

Vanilya WinXP komut satırıyla bunu yapabileceğinden emin değilim. Ücretsiz GPatch'i deneyin .


0

Muhtemelen bunun için kullanırım SED:

@echo off
cd /d c:\
attrib -r -h -s boot.ini
sed -e "s/fastdetect$/fastdetect \/bootlogo \/noguiboot/" boot.ini > boot.$$$
ren boot.ini boot.old
ren boot.$$$ boot.ini
attrib +r +h +s boot.ini

SEDGnuWin'in bir parçası olarak bulunur veya burada bağımsız bir sürüm bulabilirsiniz . Ayrıca, yazdığım gibi, SEDyukarıdakiler 'fastboot' ile biten tüm satırların yerine geçecektir. Yalnızca belirli bir satırda çalıştırıldığından emin olmak için arama dizesini daha uzun yapabilirsiniz.


Bir arama yapmak ve değiştirmek için hiçbir neden yoktur, dosyaya eklemek iyidir. Sadece yeni bir çizgi çıkarmayan bir yol istiyor.
Merhaba71

Son satır bir veya daha fazla yeni satırla bitiyorsa, "echo" tekniği iki yeni anahtarı (örneğinizde olduğu gibi, XP altında test ettik) yeni bir satırda kendi başlarına ekleyecektir. Ayrıca, boot.ini gizli bir sistem dosyası olduğu için COPY cihazınız başarısız olur.
BillP3,

0

Bilgisayarıma sağ tıklayın, özellikleri seçin. Gelişmiş sekmesine tıklayın ve ardından BAŞLATMA ve GERİ KAZANIM altında Ayarlar'ı seçin. Sistem Başlangıcı altındaki bir sonraki ekranda Düzenle'yi tıklayın. Bu, bu ve diğer anahtarları eklemenize veya başka değişiklikler yapmanıza izin vermek için Boot.ini dosyasını Not Defteri ile açar.


0

Bunu aşağıdaki geçici çözümle yapabilirsiniz:

set rand=%RANDOM%
echo /bootlogo /noguiboot > %TEMP%\%rand%.txt
attrib -R -S -H C:\boot.ini
copy C:\boot.ini+%TEMP%\%rand%.txt C:\boot.ini
attrib +R +S +H C:\boot.ini
del %TEMP%\%rand%.txt

Temel olarak, bu geçici bir dosya oluşturur, verilerinizi sonuna kadar yankı yapar, ardından geçici dosyayla copybirleştirmek C:\boot.iniiçin kullanır .


0

Bir çözüm buldum:

attrib -r -s -h %SystemDrive%\boot.ini
gsar.exe -o -i -s:032:047bootlogo:032:047noguiboot -r %SystemDrive%\boot.ini
gsar.exe -o -sfastdetect -rfastdetect:032:047bootlogo:032:047noguiboot %SystemDrive%\boot.ini
attrib +r +s +h %SystemDrive%\boot.ini

0

Peki, boot.ini sistem dosyasıdır. Bunu değiştirmeden önce bu niteliği kaldırmalısınız.

Oku ve çözümümü dene. Boot.ini içindeki klasörün WINDOWS (tümü büyük harf) olarak adlandırıldığı tüm Windows önyükleme seçeneklerini arar. Daha sonra her bir Windows önyükleme seçeneği için boot.ini dosyasını kendi tercihinize göre - "/ bootlogo / noguiboot" eklemek veya kaldırmak için - yeniden oluşturur.

@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%

0

Düzenlemek için boot.inideneyebilirsiniz:

run>sysdm.cpl

Gelişmiş sekmesinde Ayarlar ve ardından Düzenle öğesini tıklayın. Bu boot.inibir metin editöründe açılacaktır (benim durumumda Not Defteri). Düzenlemelerinizi yapın ve kaydedin (önce orijinalin bir kopyasını saklayın!).

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.