Qustions on boot.ini and reboot

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi,

My program needs to: upgrad new OS images to client systems, modify boot.ini
file to point to the new OS, then reboot the system to the new OS, if it
failes, boot back to the previous version of OS.

All these have to be done through my program running on the client systems.
Assume I have been able to put the OS image to somewhere (either a partition
on the same disk or different disks) in target system, I have the following
questions:

1) How can I modify the boot.ini to "point to" the new OS? Bootcfg seems
workable, but I have problem to boot back to the previous version. Here is
the problem (pasted from my posts to other ng):
I used the following to modify the boot.ini file on PC:
C:\>attrib c:\boot.ini -s -r -h
C:\>bootcfg /default /ID 2
My original boot.ini file is as:
-------------------------------------
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Embedded" /fastdetect
and
the modified boot.ini aft the commands looks as:
--------------------------------------
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Embedded" /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
---------------------------------------
That's fine, but when I try to change it back, i.e. change the
default to
partition(1), it never worked! The commands I used as:
C:\>attrib c:\boot.ini -s -r -h
C:\>bootcfg /default /ID 1
The boot.ini file never changed, it is always:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Embedded" /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP
Professional" /fastdetect

What's wrong with it? How can I work around it or there are other better
ways than "bootcfg"?

2) All I know "bootcfg" does is to chang default from one partition to
another, but within the same disk, can I use the command to swith the
default to a different disk? For example, I have boot.ini in one system (two
physical disks)
---------------------------------------------------------------
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced
Server" /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINNT="Microsoft Windows 2000 Server
Japanese" /fastdetect
---------------------------------------------------------------

Can I change it to:
-------------------------------------------------------------------
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(1)partition(1)\WINNT
[operating systems]
....
....
------------------------------------------------------------------

if I can, what the command should look like?

3) Is 'shutdown' shell command a standard component in XP (and win server
2003) system? In other words, if my client system are XP (and Wind Server
2003), am I safe to call 'shutdown' (after modifying boot.ini file) to
reboot the (remote) client systems in my program?

Any anwser/input is appreciated,
Peter
 
Don't know if this'll help:

I boot Win95, NT4 and XP from the one loader. To make the one I boot become
default I have, eg, boot.ini, boot.nt, boot.95. All are the same but boot.nt
has the 95 and XP default= lines commented out, boot.95 the NT4 and XP
default= lines commented out etc. Looks something like this:

[boot loader]
timeout=30
;default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
default=multi(0)disk(0)rdisk(0)partition(5)\WINDOWS
;default=C:\
[operating systems]

Via autoexec.bat or batches running from, eg, All Users\...\Startup, the
existence of two of these files is tested for, thus if booting 95 while
boot.nt and boot.xp exist, nothing happens. If only one exists, boot.ini is
renamed to the other, then boot.95 renamed to boot.ini.

I run attrib -r -h -s on each one prior to renaming, and attrib +r +h +s
after.

I may be wrong but I don't believe you can boot Windows on a slave disk
(like you can with Linux).

Shutdown.exe comes with XP (and no doubt Server 2003) but as to whether safe
to call it, who knows? Many appear to have problems with the native
Shutdown.exe, however I believe Restarting with it is not so problematic.
IIRC it goes

shutdown -r -t0

Shane


Peter said:
Hi,

My program needs to: upgrad new OS images to client systems, modify boot.ini
file to point to the new OS, then reboot the system to the new OS, if it
failes, boot back to the previous version of OS.

All these have to be done through my program running on the client systems.
Assume I have been able to put the OS image to somewhere (either a partition
on the same disk or different disks) in target system, I have the following
questions:

1) How can I modify the boot.ini to "point to" the new OS? Bootcfg seems
workable, but I have problem to boot back to the previous version. Here is
the problem (pasted from my posts to other ng):
I used the following to modify the boot.ini file on PC:
C:\>attrib c:\boot.ini -s -r -h
C:\>bootcfg /default /ID 2
My original boot.ini file is as:
-------------------------------------
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Embedded" /fastdetect
partition(2),
and
the modified boot.ini aft the commands looks as:
--------------------------------------
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Embedded" /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
---------------------------------------
That's fine, but when I try to change it back, i.e. change the
default to
partition(1), it never worked! The commands I used as:
C:\>attrib c:\boot.ini -s -r -h
C:\>bootcfg /default /ID 1
The boot.ini file never changed, it is always:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows XP Embedded" /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP
Professional" /fastdetect

What's wrong with it? How can I work around it or there are other better
ways than "bootcfg"?

2) All I know "bootcfg" does is to chang default from one partition to
another, but within the same disk, can I use the command to swith the
default to a different disk? For example, I have boot.ini in one system (two
physical disks)
---------------------------------------------------------------
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced
Server" /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINNT="Microsoft Windows 2000 Server
Japanese" /fastdetect
---------------------------------------------------------------

Can I change it to:
-------------------------------------------------------------------
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(1)partition(1)\WINNT
[operating systems]
...
...
------------------------------------------------------------------

if I can, what the command should look like?

3) Is 'shutdown' shell command a standard component in XP (and win server
2003) system? In other words, if my client system are XP (and Wind Server
2003), am I safe to call 'shutdown' (after modifying boot.ini file) to
reboot the (remote) client systems in my program?

Any anwser/input is appreciated,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top