BOOTNOW.INI automated creation script

User discussion and information resource forum for scripting of TeraByte products using script lanugages such as TBScript, VBScript, Batch Files, and more.

BOOTNOW.INI automated creation script

Postby tas3086 » Fri Oct 04, 2013 1:26 pm

Do you use BOOTNOW on your system?

Do you have to change your bootnow.ini file every time your hardware changes, plug in a flash or other drive, or BOOTITBM selects a different bootable configuration? Here's a little utility script (BOOTTIME.TBS) that will create the correct bootnow.ini file on the system that you are currently running bootnow.exe or bootndos.exe. You should run bootnow immediately after using this script. ( you need to modify the script to select a base partition name on the drive where BOOTITBM exists. If you need to specify an extended partition name, let me know. It is an easy addition.)

(This has only been tested on WINDOWS, but should work on DOS. For Linux I believe that it needs to be run from the same location that contains bootnow.exe )

It seems to me that this would be a good -option addition to BOOTNOW. All you need to specify is a partition or EMBR name that references a partition for the hard drive that contains the BIBM code.

I was unable to add this as an attachment for some reason, so here is the script.

sub main()
if TBSENV = "LINUX" then
bfile="BOOTNOW.INI"
elseif TBSENV = "DOS" then
bfile="C:\BOOTNOW.INI"
elseif TBSENV = "WINDOWS" then
bfile="c:\windows\BOOTNOW.INI"
end if
getdrvltrinfo()
n=0
h=gethdinfo(n)
while h
pn=1
while h.partition[pn]
printl("HDNum:", h.num,"-",pn,"-",0," name:", pad(h.partition[pn].name,16)," id:", hex(h.partition[pn].id))
if a1 = h.partition[pn].name THEN
fpxx=hex(h.partition[pn].id)
fdxx=h.num
end if
if a2 = h.partition[pn].name THEN
tpxx=hex(h.partition[pn].id)
tdxx=h.num
end if
// //
// Set a partition/EMBR name that exists on the hard drive where BOOTIT exists //
// vvvvvvvvvvv //
if "WinXP(32)" = h.partition[pn].name THEN
// ^^^^^^^^^^^ //
afile=open(bfile,"in-out")
if afile= -1 then
printl ("Error writing file :"#afile.errno)
end if
// seek(afile,0)
printl (" :"#bfile#" is being created to reference this drive")
writel (afile,"[OPTIONS]")
writel (afile,"HD="#h.num)
close(afile)
end if
pn=pn+1
wend
n=n+1
h=gethdinfo(n)
wend
getdrvltrinfo(0)
End sub
tas3086
 
Posts: 208
Joined: Mon Mar 19, 2012 11:15 am

Re: BOOTNOW.INI automated creation script

Postby TeraByte Support » Sun Oct 06, 2013 4:04 pm

Thanks - you could use the member PEFLAG of the partition to figure out
which partition is the active BootIt Partition (one of the bits will only be
set on for the BootIt partition, don't recall off the top of my head which
one).


"tas3086" wrote in message news:6485@public.scripting...

Do you use BOOTNOW on your system?

Do you have to change your bootnow.ini file every time your hardware
changes, plug in a flash or other drive, or BOOTITBM selects a different
bootable configuration? Here's a little utility script (BOOTTIME.TBS) that
will create the correct bootnow.ini file on the system that you are
currently running bootnow.exe or bootndos.exe. You should run bootnow
immediately after using this script. ( you need to modify the script to
select a base partition name on the drive where BOOTITBM exists. If you
need to specify an extended partition name, let me know. It is an easy
addition.)

(This has only been tested on WINDOWS, but should work on DOS. For Linux I
believe that it needs to be run from the same location that contains
bootnow.exe )

It seems to me that this would be a good -option addition to BOOTNOW. All
you need to specify is a partition or EMBR name that references a partition
for the hard drive that contains the BIBM code.

I was unable to add this as an attachment for some reason, so here is the
script.

sub main()
if TBSENV = "LINUX" then
bfile="BOOTNOW.INI"
elseif TBSENV = "DOS" then
bfile="C:\BOOTNOW.INI"
elseif TBSENV = "WINDOWS" then
bfile="c:\windows\BOOTNOW.INI"
end if
getdrvltrinfo()
n=0
h=gethdinfo(n)
while h
pn=1
while h.partition[pn]
printl("HDNum:", h.num,"-",pn,"-",0," name:", pad(h.partition[pn].name,16),"
id:", hex(h.partition[pn].id))
if a1 = h.partition[pn].name THEN
fpxx=hex(h.partition[pn].id)
fdxx=h.num
end if
if a2 = h.partition[pn].name THEN
tpxx=hex(h.partition[pn].id)
tdxx=h.num
end if
//
//
// Set a partition/EMBR name that exists on the hard drive where BOOTIT
exists //
// vvvvvvvvvvv
//
if "WinXP(32)" = h.partition[pn].name THEN
// ^^^^^^^^^^^
//
afile=open(bfile,"in-out")
if afile= -1 then
printl ("Error writing file :"#afile.errno)
end if
// seek(afile,0)
printl (" :"#bfile#" is being created to reference this
drive")
writel (afile,"[OPTIONS]")
writel (afile,"HD="#h.num)
close(afile)
end if
pn=pn+1
wend
n=n+1
h=gethdinfo(n)
wend
getdrvltrinfo(0)
End sub

TeraByte Support
 
Posts: 2273
Joined: Thu May 05, 2011 3:37 pm

Re: BOOTNOW.INI automated creation script

Postby TeraByte Support(PP) » Sun Oct 06, 2013 11:28 pm

Should be bit 14.
Paul Purviance
TeraByte Support
TeraByte Support(PP)
 
Posts: 1087
Joined: Thu Aug 11, 2011 5:51 pm


Return to Scripting