Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

When Do We Get Our Hand into BOOT.INI?

- - - - -

  • Please log in to reply
22 replies to this topic

#1
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
Hi Friends,

My question is when during install we have the first chance of editing boot.ini?

I've unsuccessfully tried [SetupParams] UserExecute= a batch file method to try editing it as late as T-9 stage but couldn't quite handle the case.

My target is simple: In a multi-boot scenario, after GUI mode setup & reboot thereafter , we get multi-boot menu with 30 secs time-out and default option of the just installed XP. While anybody has the liberty of selecting the other partition and boot that one, i want to forcibly change the time-out to zero, so that default XP boots right after the reboot. I used bootcfg command in the batch file in [SetupParams] UserExecute, but failed miserably.

Is boot.ini drafted by setup after T-9 stage and during "Saving Settings" ?

How could it be possible to change the time-out to 0 before GUI mode setup leads to reboot?

I welcome any discussion into this problem. Looking forward to you...

@MOONLIGHT SONATA
"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.


How to remove advertisement from MSFN

#2
Sonic

Sonic

    Sonic

  • Patrons
  • 1,603 posts
You install windows in already windows environment ?

#3
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
@sonic,

Yeah, for multi-boot environment having an already installed Windows Xp in another partition, that's the case i'm thinking of. That's not the case of corporate environ, yet such may be the case for home computers. What's your idea for such a situation?

===MOONLIGHT SONATA
"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#4
Sonic

Sonic

    Sonic

  • Patrons
  • 1,603 posts
I don't understand all what you say because I'm french ... but
If you install windows on fresh disk you don't have the boot menu for 30s ...
I have an idea about your situation ... start unattended setup from windows but disable the autoreboot, after bootcfg boot.ini and reboot the machine. I don't remember if it's possible to disable autoreboot from windows into unattended.txt.

#5
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
Dear Sonic,

i explain little bit to make you understand what i mean...

In one partition Windows XP is already installed. Now, if after making the 2nd partition active, unattended install is done, after GUI mode setup finished, we get Multi-boot choice menu with 2 pre-conditioned defaults set. They are : 1> Time-out is set to 30 secs and 2> The Default OS which is highlighted & obviously the Default OS is the Newly installed one, I mean the one I've just installed in the 2nd partition. Now, imagine when the Boot choice Menu waits for user intervention as to boot into which OS, I or anybody can boot into the Windows XP that resides inside the 1st partition. I want to restrict that option. If after/during GUI Mode Setup, the Time-Out could be set to zero, then the newly installed Windows XP in the 2nd partition boots without waiting for any user's choice.

bootcfg /Timeout 0 command when executed from [SetupParams] section of WINNT.SIF at T-9 stage, it doesn't produce the desired result.

Could you reflect upon where i'm doing wrong?

====MOONLIGHT SONATA

Edited by MOONLIGHT SONATA, 30 January 2006 - 12:51 PM.

"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#6
Sonic

Sonic

    Sonic

  • Patrons
  • 1,603 posts
Okay, why not use bootcfg command in cmdlines.txt ?

Edited by sonic, 30 January 2006 - 05:22 PM.


#7
prathapml

prathapml

    Follow the rules please :-)

  • Patrons
  • 6,791 posts
  • OS:Windows 8 x64
  • Country: Country Flag
Well, I can only give a suggestion:
Make a batch-file to run at T-9 stage, which executes these commands:
start /wait cmd /K
PAUSE
exit
That will give you a command prompt which you could then use, to do whatever you like. This will show you the status of the file you want to checkout:
notepad c:\boot.ini

Or if you want to view how the boot.ini looks at any other point in setup, just press the debug key-combo. [SHIFT+F10]
And that will pop-up a command window, execute any batch-file or command you want after that!

Do post back your findings! :yes:
Posted ImageCheers !!!   Donate to MSFN and Help Keep This Site Running
||Please Read the Forum Rules||  Etiquette   || Welcome to MSFN - Forum Basics || Before posting
prathapml :: MSFN Supermod :: Private Message me if you ever have a problem while at MSFN

#8
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
Dear prathapml,

I tried. In the end i'm both amazed :) and annoyed :angry: . At the T-9 minute mark pressed debug key-combo and opened boot.ini in notepad. Successfully changed timeout to 0 and saved and closed notepad. Amazing experience. I'm annoyed just because bootcfg /Timeout 0 when executed from [SetupParams] section, couldn't do the job for me. What's the reason? Two interesting things noted during the whole experience:

1. boot.ini is not read-only at that time. I got no warning when i saved it after editing.

2. When i'd gone through the exercise, there was still Windows XP installed in another partition. Even then, when i opened boot.ini, only the ongoing partition was located there. I apprehend the next partition information goes into the file at some later minutes.

Can you foresee any workaround in favour of hands-free editing of boot.ini before reboot? :}
"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#9
prathapml

prathapml

    Follow the rules please :-)

  • Patrons
  • 6,791 posts
  • OS:Windows 8 x64
  • Country: Country Flag

bootcfg /Timeout 0 when executed from [SetupParams] section, couldn't do the job for me.

Could it be because it needs to be run from a command-line?
If so, then executing from setupparams will be something like:
cmd.exe /C "bootcfg /Timeout 0"

Can you foresee any workaround in favour of hands-free editing of boot.ini before reboot? :}

The only suggestion I can think of for now, is:
open the CMD & run the command - findstr timeout c:\boot.ini
Now to replace that 2nd line thru a batch-file, MUNGE.EXE might help - http://www.ss64.com/nt/munge.html (I haven't looked into writing a script for it, do tell me if worked....)
Posted ImageCheers !!!   Donate to MSFN and Help Keep This Site Running
||Please Read the Forum Rules||  Etiquette   || Welcome to MSFN - Forum Basics || Before posting
prathapml :: MSFN Supermod :: Private Message me if you ever have a problem while at MSFN

#10
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
Dear prathapml,

Well, your advice about findstr timeout c:\boot.ini works perfectly. I'll give munge.exe a try. Can you help me by providing a sample batch file which executes munge.exe commands specific to the required task? I'm asking you just because i failed in previous effort from [SetupParams], although then i executed a .cmd file named editbini.cmd as UserExecute, which had bootcfg /timeout 0 as the desired task. May be my .cmd file had syntax errors. Could you find time?

Awaiting your kind response...


@MOONLIGHT SONATA
"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#11
cancerface

cancerface

    a n00b for life

  • Member
  • PipPip
  • 135 posts
@MOONLIGHT SONATA

I am running a (rather old) batch script from cmdlines called bootfix.bat:

bootfix.bat
@ECHO OFF
CMDOW @ /HID
IF NOT "%1"=="" GOTO EOF
ATTRIB -H -S -R %SystemDrive%\BOOT.INI
REN %SystemDrive%\BOOT.INI *.OLD
(FOR /F "tokens=1* delims==" %%A IN (%SystemDrive%\BOOT.OLD) DO IF "%%B"=="" (ECHO %%A) ELSE (IF /I "%%A"=="timeout" (ECHO %%A=0) ELSE (ECHO %%A=%%B)))>%SystemDrive%\BOOT.INI
ATTRIB +H +S +R %SystemDrive%\BOOT.INI
IF NOT EXIST %SystemDrive%\BOOT.INI (ECHO Restoring original BOOT.INI© %SystemDrive%\BOOT.OLD %SystemDrive%\BOOT.INI)
DEL /F /S /Q  %SystemDrive%\BOOT.OLD
GOTO:EOF

It will copy the boot.ini file to a new file while setting the timeout to 0sec before the reboot.
Hope this helps :)

CF

#12
prathapml

prathapml

    Follow the rules please :-)

  • Patrons
  • 6,791 posts
  • OS:Windows 8 x64
  • Country: Country Flag
I found an alternative!
First download replace.exe from - http://www.bestcode....indreplace.html

Then, put that tool on your CD, & thru a batch-file, add the path to the EXE in the below command:
attrib -s -h -r %systemdrive%\boot.ini

start /wait PATH-TO-FILE\replace.exe -srcdir %systemdrive% -find "timeout=30" -replace "timeout=0" -fname boot.ini
NOTES:
The attrib is to strip unnecessary attributes from the file so that it can be edited.
The replace.exe utility is not perfect, since it forces file search even when you know exact path, but will do for now - just be prepared to allot 10 seconds for it to finish running.

Do inform us about how it goes, if its working now, if you have any other issue, etc. :yes:
Posted ImageCheers !!!   Donate to MSFN and Help Keep This Site Running
||Please Read the Forum Rules||  Etiquette   || Welcome to MSFN - Forum Basics || Before posting
prathapml :: MSFN Supermod :: Private Message me if you ever have a problem while at MSFN

#13
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,530 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Alternatively use GSAR (Global Search And Replace) Utility
gsar -stimeout=3 -rtimeout= -io %SystemDrive%\boot.ini &&attrib +r +s +h %SystemDrive%\boot.ini
You will probably only require the executable, gsar-1.12-bin\bin\gsar.exe from the zip file.

#14
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
@Cancerface & prathapml & Yzowl,
:hello:

Many many thanks to 3 Musketeers for providing me with 3 different ways to handle this problem. Oops! I'm going to toss to decide which one to try first. But still I've one dilemma: As I want to try this method as late as possible, T-9 stage and [SetupParams]|Userexecute is the late-est control point. Do you find any technical issues if it's executed from T-9 minute mark.

Anyway, I'll try all the 3 solutions seperately and surely do inform you and seek your advice thereafter.

Thanks, mates, you made my day today. So kind of you.


----MOONLIGHT SONATA
"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#15
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
@Cancerface & prathapml & Yzöwl,

Hey, i've finally tested out all the three ! :D

Dear prathapml,

replace.exe works well, but if not those ~10 seconds!. Anyway, it serves its purpose fully. Thanks for week long support that you've provided me. :)

@Cancerface
bootfix.bat has given me error not at run-time, but after reboot. Message was that of finding no boot.ini. I booted from BARTPE bootcd and really found that there's no boot.ini in SystemDrive. I find no apparent error in your bootfix.bat file, but in the end i've to swallow the error. No offence meant. Never mind!

Finally,

Dear Yzöwl,

As I expected, your advice works flawlessly. There's so much to learn whenever you post your code for us. In every interaction that we're fortunate to have with you, you surprise us by advising new and new ways to handle our problems. More and more we learn from you, more and more we realize how little our knowledge base is! Till date, i didn't find an iota of bug in scripts posted by you. And sorry, sometimes i do really search bug in your post just to believe that we interact with someone whose scripts not only have Midas touch, but also comes from someone who is more humane. Thanks, take my indebtness as my gratitude for these awsome scripts@Yzöwl. :thumbup

Edited by MOONLIGHT SONATA, 12 February 2006 - 11:56 AM.

"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#16
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,026 posts
  • OS:none specified
  • Country: Country Flag
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, 15 February 2006 - 05:43 AM.


#17
MOONLIGHT SONATA

MOONLIGHT SONATA

    Member

  • Member
  • PipPip
  • 203 posts
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, 15 February 2006 - 01:46 PM.

"If Moore's Law holds true, and you have a problem that will take current computers a 1,000 years to solve, you might as well go away to a beach for 14 years, come back and solve the problem in one year." ------James Gosling, the Father of JAVA Programming Language.

Time Is Now to Hit that Beach.

#18
cancerface

cancerface

    a n00b for life

  • Member
  • PipPip
  • 135 posts
@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, 21 March 2006 - 06:56 PM.


#19
cancerface

cancerface

    a n00b for life

  • Member
  • PipPip
  • 135 posts
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, 21 March 2006 - 06:57 PM.


#20
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,026 posts
  • OS:none specified
  • Country: Country Flag
Command line usage help for WMIC.EXE:
http://www.ss64.com/nt/wmic.html

jaclaz

#21
cancerface

cancerface

    a n00b for life

  • Member
  • PipPip
  • 135 posts
@jaclaz
I have used the msdn page although you can get all the info from the cmd prompt ... ;)
wmic.exe /?

CF

#22
Yurek3

Yurek3

    Member

  • Member
  • PipPip
  • 270 posts
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, 22 March 2006 - 05:57 PM.


#23
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,026 posts
  • OS:none specified
  • Country: Country Flag
@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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN