Jump to content











Photo

Automatic Changing of BOOT.INI by bat file


  • Please log in to reply
15 replies to this topic

#1 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 30 May 2008 - 10:54 AM

=================================================================
Automatic Changing of BOOT.INI by bat file
(Windows XP Tips)
=================================================================

Hi

Many of my good friends have made their favorite Boot Screen and
they know that they should edit boot.ini to use their boot screen
but they wanted to know how to change boot.ini in automatic
process inside their system and when installing windows XP.

This work is very easy,but you should pay attention to notes bellow
then i will give you an bat file to do what you want.

1.As you see in my tutor (link bellow),Windows xp uses differnt files
for display boot screen,with respect to kind of CPU that you use.as
i said on that tutor ,1st you should make 2 boot screen files,one
for single processor cpu and another for dual processor.


http://www.boot-land...?showtopic=4448

2.If you make just one type of boot screen in your system,it will be
made with respect to type of your CPU,so that boot screen file will
work on your system,But if you want to use that by another computer
it will work just by computrs that has CPU spefications as yours.and
will not work by other kinds of computers and their system will halt
during boot.
So you have to make at least 2 kinds of boot screen to work on most
computers(see my tutor on link above).

3.What we should do after making our boot screens? there is very good
tutor in MSFN site that talks about this object an i am going to say
it shortly bellow:

======================================================================
I suppose that you have made your boot screen files by the names of:

BootA.exe (for single kernel)
BootB.exe (for Dual kernel)

And I suppose that you have saved them in your "system32" directory.
======================================================================

Now open notepad and copy script below on it then save by the name of
MyBoot.bat (be sure to save as bat file not txt file!).

-------------------------------------------
FOR /F "tokens=3 delims= " %%A IN (\'REG QUERY "HKLM\SYSTEM\ControlSet001\Control\Session Manager
\Environment" /v NUMBER_OF_PROCESSORS\') DO SET NUMBER_OF_PROCESSORS=%%A
bootcfg /copy /D "Windows XP Professional" /ID 1
if %NUMBER_OF_PROCESSORS%==2 goto DUAL
bootcfg /RAW "/Kernel=BootA.exe" /A /ID 2
goto End
:DUAL
bootcfg /RAW "/Kernel=BootB.exe" /A /ID 2
:End
bootcfg /Default /ID 2
-----------------------------------------------

By running this batch file,it will check systems registry,will
find type of system CPU,and will use proportional file with respect
to your system.

I mean that it will change your boot.ini,with respect to your cpu
If you are using singkeknl type it will add using BootA.exe to your boot.ini
and if you have dualknl it will add BootB.exe.

=====================================================================
that's all. hope will help

if needed ask questions,

thank you

shirin

#2 ispy

ispy

    Silver Member

  • Tutorial Writer
  • 646 posts
  • Location:PILGRIM

Posted 30 May 2008 - 07:37 PM

Hi Shirin ;) ,

Another gem from the master XP Tweaker Mr Shirin! What you have touched on here is one of the things I am currently interested in but from a restitution perspective of the boot.ini file.

First off the boot.ini is a hidden file the attributes of which (Hidden) need to be removed before any editing takes place otherwise a batch or CMD file will probably fail. Then I was going to provide a front end menu of choices similair to the repair routine that you can execute in recovery console together with a menu driven boot.ini editor & ntldr fix routine, trouble is there are many switches & dual booting considerations that could prohibit this idea.

The idea was to also utilize psc's puzzleXP as the driver instead of PicoXP which I am told is a little dated. The whole lot could be driven from a batch file with a front end menu but not sure how feasible it would be. Your Tutorial addresses another consideration in respect of single or dual processor setups, Many Thanks keep up the good work it is appreciated!

Regards & Respect,

ispy :thumbup:

#3 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 30 May 2008 - 10:50 PM

[quote name='ispy' date='May 30 2008, 08:37 PM' post='36511']
Hi Shirin ;) ,

Another gem from the master XP Tweaker Mr Shirin! What you have touched on here is one of the things I am currently interested in but from a restitution perspective of the boot.ini file.

==========================================

Hi My dear Friend ispy

Thank you very much.
You allways make me very hapy.I am so glad that i have you dear friend.and i hope to see you
some day.
I allways need your mentions and helps to learn more.

Thank you very much again

shirin

#4 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 31 May 2008 - 03:34 PM

Very good methods that you've been posting shirin, excellent work! ;)

#5 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 31 May 2008 - 04:44 PM

Very good methods that you've been posting shirin, excellent work! ;)

=============================
Hi Dear Nuno Brito

thank you for replay

I have a question dear Nuno.Would you tell me the process of booting LiveXP?

When using LiveXP of winBuilder in my Multiboot works,i can not make it to run.Ofcourse it works
very well as ISO for virtual machins,and also works very good and fast after burning(if i use it alone).but when using as item of multiboot it does not.

where do i have mistake.i tried using bootsector.bin and also setuplde.bin,but they cant.

hope you will help me to learn more.

have nice times

shirin

#6 benxhi

benxhi

    Member

  • Tutorial Writer
  • 87 posts
  • Location:Shkup
  •  
    Albania

Posted 31 May 2008 - 08:59 PM

Nice script ;) Very good . THANKS.
(i'm thinking about turning all these tutorials into PDF format , so any ideas?).


/benxhi

#7 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 31 May 2008 - 09:39 PM

Nice script ;) Very good . THANKS.
(i'm thinking about turning all these tutorials into PDF format , so any ideas?).


/benxhi

====================================================
Hi Dear benxhi

That is very good idea and will make me very happy if you please do that.
My dear friend ispy asked me that some days ago.But really i do not have enough time,
so if you do that,it will make me very happy and will be great help for me

thank you
shirin

#8 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 31 May 2008 - 11:19 PM

....
When using LiveXP of winBuilder in my Multiboot works,i can not make it to run.Ofcourse it works
very well as ISO for virtual machins,and also works very good and fast after burning(if i use it alone).but when using as item of multiboot it does not.

where do i have mistake.i tried using bootsector.bin and also setuplde.bin,but they cant.
....



LiveXP is a XP PE environment so you should rename the I386 folder to minint when trying to boot from a disk or usb media and also remember to rename setupldr.bin to NTLDR.

You can use this topic made by Alexei as guide: http://www.boot-land...?...post&p=3399


If you're trying to multiboot from CD/DVD instead of USB or Hard Disk then I suggest using BCDW for multi booting LiveXP or XP install Files (grub4dos can launch bcdw).

The UXP project illustrates very well how to dual boot a XP install CD mixed with a LiveXP environment, you can download it and use as reference.


Nice script ;) Very good . THANKS.
(i'm thinking about turning all these tutorials into PDF format , so any ideas?).
/benxhi


Good idea! :thumbup:

#9 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 31 May 2008 - 11:27 PM

[quote name='Nuno Brito' date='Jun 1 2008, 12:19 AM' post='36593']
LiveXP is a XP PE environment so you should rename the I386 folder to minint when trying to boot from a disk or usb media and also remember to rename setupldr.bin to NTLDR.

===============================================
Hi dear Nuno Brito

thank you very much for this nice replay

Now in my country is 3:54 after midnight,so i am going to use your nice advice tomorrow.

thanks again for fast replay
have nice times

shirin

#10 ispy

ispy

    Silver Member

  • Tutorial Writer
  • 646 posts
  • Location:PILGRIM

Posted 01 June 2008 - 07:57 PM

@ benxhi ;) ,

You have asked about turning all these tips into one pdf document?

My proposal is as follows:

Get hold of a portable version of open office see here:

http://portableapps....office_portable

Next install where-ever you like (even off usb stick)

Open the open office equivelent version of MS word, setup up your page format the way you want it in the settings

Then copy and paste all the stuff you want from "Shirins" tutorials into it!

Then on the top task bar you will notice a PDF icon that once you click on will convert the whole file into PDF in one fell swoop, upload & jobs done!

One reservation though, if you want to set up hyperlinks to to jump around the document from say a contents page, then these for me get broken in the conversion. Hence the reason (for me) to select .doc format instead, to retain the hyper links that is, Pro's & cons I'm afraid!

However this is a nice feature of open office as against MS word that does not have the PDF conversion facility

Hope this helps?

Regards & Best Wishes,

ispy :thumbup:

#11 rawr

rawr

    Frequent Member

  • Advanced user
  • 163 posts

Posted 01 June 2008 - 10:34 PM

about the links thing

One reservation though, if you want to set up hyperlinks to to jump around the document from say a contents page, then these for me get broken in the conversion. Hence the reason (for me) to select .doc format instead, to retain the hyper links that is, Pro's & cons I'm afraid!


tragic !! broken links that aint no good , where would the internet be with out the url ..!

alternative path: DoNot open office! :thumbup:

open NotePad(++ preferably) ;)
and open a '<pre>'-tag
eg : <pre> tutoral(s)GoHear! </pre>
now above/before the opening '<pre>' add <html><body>
and after/below the closing '</pre>' add </body></html>
save file as tutor.html
example attached

having now a (just)valid html file should be enough to consider the html2pdf option below

http://html2fpdf.sou...et/examples.php
http://html2fpdf.sou...net/license.php
http://html2fpdf.sou...rge.net/faq.php


http://www.htm2pdf.co.uk/ <---on line html>pdf ! [@ ispy.. link<-has 'Make links active?' option ]

free html2pdf test (with-'Make links active' == true...box-ticked;-)
::edit - didnot like to render double spaces ... removed them to get it to work ... tho <br/> would work and keep original format

html size-3.13K
Attachment (pdf) space used 13.4K -- made with above htm2pdf.co.uk/ =]
:thumbup:
links are good to go ... see attached PDF (its shuld now be 'in-full' thanx! shirin)

Attached Files



#12 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 01 June 2008 - 10:55 PM

[quote name='ispy' date='Jun 1 2008, 07:57 PM' post='36646']
@ benxhi ;) ,

You have asked about turning all these tips into one pdf document?

My proposal is as follows:

Get hold of a portable version of open office see here:

--------------------------------------------
Hi my dear friend ispy

thank you for your good advice,i did not know this properties of open office.
by the way because "benxhi" asked me,i think it is unpolite to do myself.
so i will wait for him.and i am sure that he knows computer better than me.

Thank you very much for thinking about me,helping me and giving really good advices to me.

have nice times

shirin

#13 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 01 June 2008 - 11:08 PM

[quote name='rawral' date='Jun 1 2008, 10:34 PM' post='36650']
about the links thing


tragic !! broken links that aint no good , where would the internet be with out the url ..!

alternative path: DoNot open office! ;)

----------------------------------------------------------------------------
HI rawral

i downloaded your PDF,it is not complate.

any way thank you
shirin

#14 rawr

rawr

    Frequent Member

  • Advanced user
  • 163 posts

Posted 01 June 2008 - 11:33 PM

HI rawral
i downloaded your PDF,it is not complate.
any way thank you
shirin



thanx ;)

fixed it .

#15 benxhi

benxhi

    Member

  • Tutorial Writer
  • 87 posts
  • Location:Shkup
  •  
    Albania

Posted 02 June 2008 - 09:54 AM

i will do it in this way as follows , sorry but i was busy at school (end of the year) so i couldn't do it i'm starting today and it will not take me much time ;)
i do this there is a freeware application named PDFcreator it installs a pdf printer on your PC so i will just COP-Paste the text and add pictures than just type ctrl+p and select the pdfcreator printer :thumbup: .\
/benxhi.

#16 thunn

thunn

    Silver Member

  • .script developer
  • 531 posts
  • Location:Brooklyn, New York
  • Interests:computers<br />mechanics<br />distortion<br /><br />
  •  
    United States

Posted 22 July 2008 - 02:51 PM

--good stuff.
I really like the ideas at work!

But checking the registry is not always reliable...

As of late I use a 3rd party tool (crystalcpuid) to verify more than one physical cpu before proceeding with changes (like the correct HAL if needed). :cheers:

To edit bootini, I use a 1 KB replace.vbs, first checking if the string exists to avaoid nonsense...

for %%B in &#40;C D E F G H I J K L M N O P Q R S T U V W X Y Z&#41; do if exist %%B&#58;\boot.ini &#40;

attrib -s -r -h %%B&#58;\boot.ini

&#41; && &#40;

findstr /c&#58;&#34;Longhorn&#34; %%B&#58;\boot.ini

if %errorlevel% equ 0 &#40;replace.vbs %%B&#58;\boot.ini &#34;/DETECTHAL&#34; &#34;/NOEXECUTE=ALWAYSOFF&#34; && replace.vbs %%B&#58;\boot.ini &#34;Longhorn&#34; &#34;XP Professional&#34;&#41;

for %%V in &#40;30 3 0&#41; do &#40;findstr /c&#58;&#34;timeout=%%V&#34; %%B&#58;\boot.ini && if %errorlevel% equ 0 replace.vbs %%B&#58;\boot.ini &#34;timeout=%%V&#34; &#34;timeout=10&#34;&#41;

attrib +r +s +h %%B&#58;\boot.ini

if exist %%B&#58;\boot.bak &#40;

attrib -s -r -h %%B&#58;\boot.bak

move /y %%B&#58;\boot.bak %systemroot%\debug

&#41;

&#41;


&#39; ----------------------------------------------------------------------------------

&#39;  Replace.vbs

&#39;  usage&#58; cscript replace.vbs file.txt &#34;find String&#34; &#34;replace with String&#34;

&#39;

&#39;  source&#58; Microsoft Scripting Guy Archives Feb. 2005

&#39;  http&#58;//www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0208.mspx

&#39; ----------------------------------------------------------------------------------



Const ForReading = 1

Const ForWriting = 2



strFileName = Wscript.Arguments&#40;0&#41;

strOldText = Wscript.Arguments&#40;1&#41;

strNewText = Wscript.Arguments&#40;2&#41;



Set objFSO = CreateObject&#40;&#34;Scripting.FileSystemObject&#34;&#41;

Set objFile = objFSO.OpenTextFile&#40;strFileName, ForReading&#41;

strText = objFile.ReadAll

objFile.Close



strNewText = Replace&#40;strText, strOldText, strNewText&#41;

Set objFile = objFSO.OpenTextFile&#40;strFileName, ForWriting&#41;

objFile.WriteLine strNewText

objFile.Close





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users