Boot Order Help

December 11, 2009 at 16:02:00
Specs: Windows XP
Hello, I have been trying to find a solution to this and so far I have not found an answer.
I have a dual boot system in which i have Windows XP Pro and Windows XP Pro X64 on separate hard drives.
I would like to create a shortcut to restart and boot to the other os so I can do this unattended. I need to do this from time to time, because I have some different programs on each of the drives. I found that It can be done in Vista using a batch file with bcdedit.exe. As far as I know, Xp does not have such a program.
I thought of somehow creating a batch file that would change the boot.ini reboot and after it reboots to the other drive it would change back to the original boot.ini. Is there a way to do this. I have very little experience with creating batch files and could use some help. Thank you in advance.

See More: Boot Order Help

Report •


#1
December 11, 2009 at 17:17:56
We used to do that with dos. Not sure you can do from a batch anymore by maybe. You have to use fdisk to set the partition active. We used a keyboard input (I forget name be was part of old dos) then make a text file as input to the fdisk program.

As you say Win 7 and Vista use bdc and it could be used in you have access to a dvd.


I'd bet that on softpedia they have a deal to do this.

Playing to the angels
Les Paul (1915-2009)


Report •

#2
December 11, 2009 at 18:04:39
There are 2 small programs on winxp that helps to manage this.
The first program is bootcfg.exe.
This changes the boot.ini file for you.

E.g.
bootcfg /default /id 2

changes the boot.ini default boot and makes the second entry to the first and the first to the second.
That means, another
bootcfg /default /id 2
again changes 2 to 1 and 1 to 2 and you're back at the beginning.
Open a command prompt and use bootcfg /? to see the possible options.

The second program to reboot the system is called shutdown.exe and is also part of winxp.
shutdown -r
will reboot your system.

So a small batch file can look like this.

@Echo off
rem START cosar (Change Os And Reboot)
rem Batch file to change default system and reboot
%SystemRoot%\system32\bootcfg /default /id 2
%SystemRoot%\system32\shutdown -r
rem END cosar (Change Os And Reboot)

Save this file and create a link on the desktop.


Report •

#3
December 11, 2009 at 23:01:01
Isn't Bootcfg a Recovery Console command not available at the Command Prompt?

Report •

Related Solutions

#4
December 12, 2009 at 05:26:36
http://support.microsoft.com/kb/291980
A discussion about the Bootcfg command and its uses

Note The Bootcfg.exe utility is only available in Windows XP Professional, (when using it in CMD). This utility is not available in Microsoft Windows XP Home Edition, as stated in this ----
http://support.microsoft.com/defaul...
HOW TO: Edit the Boot.ini File in Windows XP


Report •

#5
December 12, 2009 at 13:32:29
Thank you Paulsep for going into such good detail. I tried it and it works great. The only problem is I'm not sure how to chang it back to the default boot order. i have been playing around with the batch file trying to revert it back, but to this point, it stays in the reverse order.

Report •

#6
December 12, 2009 at 15:11:29
Soundguy585

try the following, to understand, how bootcfg works:

1. in cmd, use bootcfg /query, to see the curren boot settings
2. now use bootcfg /default /id 2
3. and again use bootcfg /query
4. then use bootcfg /default /id 2 again

The boot order should have been changed back to the original state.


Report •

#7
December 12, 2009 at 17:00:25
I did what you posted. When I use "bootcfg /default /id 2" it says "Wrong boot id specified". Any other ideas besides going in and manually change the boot order?

Report •

#8
December 13, 2009 at 03:34:17
What does a bootcfg /query show to you?

Report •

#9
December 13, 2009 at 12:13:49
Bootcfg /query shows :

default:multi<0> disk<0>rdisk<1>partition<1>\windows

Boot Entries

boot entry id: 1
os friendly name: windows xp x86
Path: multi <0> disk<1>rdisk<1>partition<1>\windows
os load options: /noexecute=optin /fastdtect

boot entry id: 2
os friendly name: windows xp x64
Path: multi <0> disk<0>rdisk<0>partition<1>\windows
os load options: /noexecute=optin /fastdtect

This is the boot order after using the batch file you gave me. My normal boot order is reverse of this. Thanks


Report •

#10
December 13, 2009 at 14:31:56
Ok, and the command bootcfg /default /id 2 will make boot entry is 2 to boot entry id 1 and vice versa.

As described in Response 6, you can check the changes.

Do you have another boot.ini on the other disk, that may have only one boot entry?


Report •

#11
December 13, 2009 at 14:59:39
yes, on the xp pro x86 it is:


[boot loader]
timeout=60
default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP 32 Bit" /noexecute=optin /fastdetect /usepmtimer


Report •

#12
December 13, 2009 at 15:04:11
And that's, why you get the error.
You should add an entry for the x64 system to this boot.ini file.

Report •

#13
December 15, 2009 at 13:42:24
The last couple days i have been trying different things. I added the x64 operating system to the boot.ini of the x86 system, like you said. It did not work. I also tried editing the batch file you gave me by removing the shutdown line and then saving it to the start up folder, thinking that it would reset it to my default OS(X64)setup. That did not work. It just won't reset back to the default boot order. I am not one to give up, so I will keep trying. I find it kind of fun to do things like this as long as I don't create a cataclysmic failure of epic proportions....

Report •

#14
December 15, 2009 at 14:10:18
But what about editing boot.ini as if it is a regular textfile (which it is) ?

I mean, you don't need BCEDIT to be able to alter a file ...

And if editing a file is not an option, you can precreate 2 different boot.ini's, example:

boot primary to 32-bit XP : boot_32.ini
primary boot to XP-64-bit : boot_64.ini

Then use some DOS commands to copy either boot_32.ini or boot_64.ini to C:\boot.ini

You can use CHOICE.COM for that, even if not native Windows XP


Report •

#15
December 15, 2009 at 15:24:59
How many boot entries are listed in your boot.ini file?
If only 2 entries are listed, there should be no problem.

You can still play around with bootcfg in a command prompt and then you can check, whether the changes you made, are correct by using bootcfg /query in the command prompt.


Report •

#16
December 15, 2009 at 19:55:46
I have 2 entries on each drive. Here they are:
X86:
[boot loader]
timeout=60
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional x64 Edition" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP X86" /noexecute=optin /fastdetect /usepmtimer


X64:

boot loader]
timeout=20
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional x64 Edition" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP X86" /noexecute=optin /fastdetect


Report •

#17
December 16, 2009 at 07:44:42
You see, using two boot.ini on different partitions isn't the key, because you never know, how it is actually switched.

Therefore it's easier to use two boot.ini files like this on both partitions.
Filename: boot.x64
{boot loader]
timeout=20
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional x64 Edition" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP X86" /noexecute=optin /fastdetect

Filename: boot.x86
[boot loader]
timeout=60
default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP X86" /noexecute=optin /fastdetect /usepmtimer
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional x64 Edition" /noexecute=optin /fastdetect

Now you can create a batch file for each boot option like this:
Filename: bootx64.bat
@echo off
rem Boot into Windows XP Professional x64 Edition
copy /y %SystemDrive%\boot.x64 boot.ini
shutdown -r

Filename: bootx86.bat
@echo off
rem Boot into Microsoft Windows XP X86
copy /y %SystemDrive%\boot.x86 boot.ini
shutdown -r

Save both batch files to your desktop.
Doubleclicking e.g. bootx86.bat sets the system to boot into "Microsoft Windows XP X86" until you doubleclick the bootx64.bat file and vice versa.
But this files (boot.x64.ini, boot.x86.ini, bootx64.bat, bootx86.bat) must exist on both windows drives.


Report •

#18
December 17, 2009 at 15:36:36
Paulsep, Thank you so much for your help. Your last submission seemed to work well. I took the batch file for the x64 system and removed the shutdown command and put a shortcut in the startup folder and that way when the x86 system boots it switches back to my default boot options. It will do just fine in accomplishing what I set out to do. It's great to have people like you who are willing to help people like me, who have no clue what we are doing.This is a great learning experience. Thanks to all.

Report •

#19
December 17, 2009 at 16:03:44
Soundguy585

you are welcome.
I'm glad, that it works for you.


Report •


Ask Question