Jump to content

Recommended Posts


Posted

You could disable write-protect, edit, save, then re-enable...or you could right-click on my computer, properties, advanced, startup and recovery settings, and then there is an edit button that will open boot.ini in a temporary editable mode.

Posted

Maybe I'm not understanding the question but he's saying that he wants to modify it without user input.

If so, I'd recreate it with a batch file.

attrib -r -s -h %systemdrive%\boot.ini

rename %systemdrive%\boot.ini boot.old

echo [boot loader] > %systemdrive%\boot.ini

echo timeout=30 >> %systemdrive%\boot.ini

echo default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS >> %systemdrive%\boot.ini

echo [operating systems] >> %systemdrive%\boot.ini

echo multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=AllwaysOff /fastdetect >> %systemdrive%\boot.ini

attrib +r +s +h %systemdrive%\boot.ini

... With the appropriate substitutions, of course.

If I missed the question altogether, disregard.

Posted (edited)

This is mine bot.ini

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

TITLE Modifiy Boot Delay

@echo off

SET ProgPath=C:

SET ORIG=%ProgPath%\Boot.ini

SET NEW=%ProgPath%\Boot_New.ini

ATTRIB -R -S -H %ORIG%

IF EXIST "%NEW%" (

ATTRIB -R -S -H %NEW%

DEL /Q "%NEW%"

)

FOR /F "delims=*" %%L IN (%ORIG%) DO (

SET Begin=%%L

IF "!Begin:~0,8!" == "timeout=" (

ECHO.timeout=4 >>"%NEW%"

) ELSE (

ECHO.%%L >>"%NEW%"

)

)

COPY /Y %ORIG% %ORIG%_OLD

COPY /Y %NEW% %ORIG%

bootcfg /raw /id 1 "/noexecute=AlwaysOff /NOPAE /fastdetect"

Edited by Yurek3
Posted

@Yurek3:

Why hard batch to set timeout ??

With bootcfg you can use

bootcfg /timeout 4

/!\ bootcfg isn't available in Home Edition ...

Posted

I use a vbScript I wrote to modify the file:

Here is a copy of the script.

' Modify Boot.ini file attributes

Set objFSO=CreateObject("Scripting.FileSystemObject")

Set objFile=objFSO.GetFile("C:\boot.ini")

If objFile.Attributes AND 2 Then

objFile.Attributes=objFile.Attributes AND 0

End If

'Modify Boot.ini timing parameters

Set TF=objFSO.OpenTextFile("C:\boot.ini",1) '1=ForReading

inp=TF.ReadAll

out=Replace(inp,"30","10")

Set TF=objFSO.CreateTextFile("C:\boot.ini",True)

TF.Writeline out

TF.Close

' Set Boot.ini file attributes back to Hidden & System

If Not objFile.Attributes AND 1 Then

objFile.Attributes=objFile.Attributes XOR 2

objFile.Attributes=objFile.Attributes XOR 4

End If

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...