Jump to content

Unattended boot.ini


 Share

Recommended Posts


This batch file worked perfectly for me...I have it set to 5 secs, you can set it to whatever...copy this to a bat file:

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

TITLE Modifiy Boot Delay

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=5 >>"%NEW%"

) ELSE (

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

)

)

COPY /Y %ORIG% %ORIG%_OLD

COPY /Y %NEW% %ORIG%

Link to comment
Share on other sites

Just a couple of suggestions with the above:

You don't need to SET ProgPath=C:

%SystemDrive% will already do this and will not be hardcoded to a specific drive letter

Since you have removed the attributes from the Boot.ini, it would be good to finish off the code by at least re-applying the hidden attributes to %ORIG% and preferably %ORIG%_OLD (+H) to the end of it.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...