Jump to content

When Do We Get Our Hand into BOOT.INI?


Recommended Posts

As every one has shared some knowledge, I'll throw my two cents in:

@ECHO OFF
REM ATTRIB -H -S -R C:\BOOT.INI
echo [Boot Loader] > C:\boot.tmp
echo Timeout=0 >> C:\boot.tmp
type boot.ini | FIND /V "[Boot Loader]" | FIND /V "Timeout=" >> C:\boot.tmp
Copy C:\BOOT.TMP C:\BOOT.INI > NUL
DEL C:\BOOT.TMP
REM ATTRIB +H +S +R C:\BOOT.INI

(you will need to UNrem the two remmed lines)

Maybe it's brutal, but no need for FOR loops, conditional statements or external utilities....;)

jaclaz

P.S.: the line "type boot.ini | .....>> C:\boot.tmp" has to be on the SAME line

Edited by jaclaz
Link to comment
Share on other sites


Dear jaclaz,

It's interesting. My earlier brush with a script from cancerface yielded no positive results. your and his looks a lot have in common. I'll give it a try, but i always test in real install instead of VMs. So, it'll take a couple of days as i've to get ready a few more things for the next install.

BTW, in this context i wish to mention a few more observations that may interest all of us. Here are they...

1. Just to fix timeout to 0 could be done without a script. I've noticed that setting,

[setupData]

OsLoadTimeout=0

in WINNT.SIF file really fixes the issue.

2. However, if our WINNT.SIF looks like below,

[setupData]

OsLoadTimeout=0

OSLoadOptionsVar="/noexecute=AlwaysOff"

OSLoadIdentifier="Windows XP SP2 UnAttended"

then, /noexecute=AlwaysOff gets inserted into Boot.ini but doesn't serve its purpose as boot.ini then looks like,

[boot loader]

timeout=0

default=multi(0)disk(0)rdisk(0)partition(4)\WINDOWS

[operating systems]

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

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

So, disabling software-based DEP couldn't be handled properly as the default /noexecute=optin is enetred irrespective of what we set under OSLoadOptionsVar.

To me it seems that it's only fit for 64-bit edition, directly.

3. As for the OSLoadIdentifier="Windows XP SP2 UnAttended", it really doesn't take off at all. Boot.ini still shows only "Microsoft Windows XP Professional". No effect.

I'll much like if such things could be managed by a batch file as you, Yzowl and prathapml tried to formulate for the timeout issue.

Thanks.

Edited by MOONLIGHT SONATA
Link to comment
Share on other sites

  • 1 month later...

@MOONLIGHT SONATA

Sorry for the laaaaaate response but I did not keep up with this thread :(

Anyway, you didn't find anything wrong with the script I posted, but looking at the code just now I reallized that copy/paste in fact altered it a bit:

It should read:

IF NOT EXIST %SystemDrive%\BOOT.INI (ECHO Restoring original BOOT.INI© %SystemDrive%\BOOT.OLD %SystemDrive%\BOOT.INI)

yet if the above is entered within CODE tags it gives:

IF NOT EXIST %SystemDrive%\BOOT.INI (ECHO Restoring original BOOT.INI&COPY %SystemDrive%\BOOT.OLD %SystemDrive%\BOOT.INI)

... I just spotted the difference :) the &COPY becomes a copywrite sign © :)

I can confirm that the script works if run from cmdlines, although I run it right after I install recovery console (from cmdlines) ... Not sure if this changes things for you

CF

@jaclaz

You're right, the script I posted is unreasonably complicated :) I think I picked it up from some site looooong time ago...

[Edit]

The script came from Rob van der Woude's site and can be found here. There is also another version that may be of use to MOONLIGHT_SONATA here.

Edited by cancerface
Link to comment
Share on other sites

Playing around with wmic.exe I saw that you can change some Boot.ini options.

In order to get a 0sec delay you can try:

%SystemRoot%\System32\Wbem\wmic.exe ComputerSystem Set SystemStartupDelay="0"

Also it seems that you can set the boot parameters as well as the name that appears on the boot menu with:

%SystemRoot%\System32\Wbem\wmic.exe Set SystemStartupOptions="<options>"

This however is a bit more complicated so you might want to try on a working machine the next in order to get an idea of what the SystemStartupOptions might be:

%SystemRoot%\System32\Wbem\wmic.exe Get SystemStartupOptions

Note that the above were not tested upon building a machine ie I am not sure if wmic.exe is accesible via cmdlines ...

CF

Edited by cancerface
Link to comment
Share on other sites

this is mine boot.ini

@echo off

ATTRIB -R -S -H %systemdrive%\boot.ini

del /F /Q %systemdrive%\boot.ini

SET inifile="%systemdrive%\boot.ini"

ECHO [boot loader]>> %inifile%

ECHO timeout=4 >> %inifile%

ECHO default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS >> %inifile%

ECHO [operating systems] >> %inifile%

ECHO multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Professional" /noexecute=ALWAYSOFF /fastdetect >> %inifile%

ATTRIB +R +S +H %systemdrive%\boot.ini

Edited by Yurek3
Link to comment
Share on other sites

@Yurek3

If you change the line

ECHO [boot loader] >> %inifile%

to

ECHO [boot loader] > %inifile%

(taking out a > )

you can remove the line

del /F /Q %systemdrive%\boot.ini

from your batch.

jaclaz

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
  • Recently Browsing   0 members

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