Toggling The Default OS (98/2000) Introduction This article is for users who are dual-booting their machine with Windows 2000 and Windows 98. For information on how to set up your machine for dual-booting, please read the dual-boot how- to at http://www.pcnineoneone.com/howto/dualboot1.html. As a lot of people move into dual operating systems, we all have to decide which will be our default OS of choice. Whenever we want to switch to another OS, we have to reboot and select another system to use at the boot menu. This usually requires being right at the keyboard during the boot up routine and selecting the OS before the timer runs out. It is a good bet that we've all had been there while rebooting and experienced something that has caused us to miss the boot prompt, sending us back to the default OS. Perhaps you were talking with someone, or perhaps distracted by something out the window or even mislead by the belief that you still have the physical ability to make it to the coffee pot and back to the computer to beat the default timer. You turn back just in time to see the menu slipping away and you have to reboot to choose all over again. Furthermore, if you're a gamer like I am who keeps Win98 just for gaming, we all want to slip away to the fridge for some drink before sitting down to hours of gaming. Why not automate how to set the default OS from the desktop and not hassle with the fuss? In this article we'll set up a couple of batch files to take the load off of your rebooting woes. Why batch files? Sure, we could write some toggle.c program, compile it and distribute to all of our friends. Or even write some script to handle it quietly behind the scenes. Batch files are simple and anyone who can open a text editor can put one together with minimal know-how. Besides, it's early in the morning and I want to keep it simple. Boot.ini files - Win2K We'll need to boot into Windows 2000 first. Since the most vital information is gathered from its own boot management system, it's the choice place to start. 1 - Boot into Windows 2000 2 - Open the drive that contains the boot.ini file In most cases, this is the C: drive. If you cannot see the file, you may need to adjust your folder properties to allow you to see hidden system files. From the folder Tools menu, select Folder Options. Select the View tab and select Show hidden files and folders. I find that deselecting Hide files extensions for known file types is useful in everyday situations, so you may choose to do this also if you'd like. Hit Apply and then Ok. 3 - Create a backup of the boot.ini file Backing up files is always key when exploring or altering new things. For reference, we'll call the backup file boot.bak 4 - Open the System Properties dialog by opening My Computer / Control Panel / System / Advanced Leave it open for a bit, as we'll be using it a couple of times. 5 - Copying the Windows 2000 boot information From the Advanced tab, select Startup and Recovery. What we want to do now is to get the information that Windows uses during bootup to start each OS properly. We'll find how to get this from the Startup and Recovery section. In the System startup section, select Windows 2000 as the Default operating system. You can change the Display list of operating systems for XX seconds now or later to fit your needs. Mine is set at 10 seconds. What we have just done is to set the boot parameters that will be written to the boot.ini file. Hit Ok and now we're ready to go take a look at what has been done. To see the parameters, open boot.ini in a text editor (Notepad will suffice). You should see something like this: [boot loader] timeout=10 default=multi(0)disk(0)rdisk(0)partition(2)\WINNT [operating systems] multi(0)disk(0)rdisk(0)partition(2)\WINNT="Microsoft Windows 2000 Professional" /fastdetect C:\="Microsoft Windows" So, here we see that that computer will default to WINNT when booting. You can always change the timeout default by setting timeout=XX to XX seconds if you want to change the default in the future. Now, let's create the file that will hold the Win2K boot info. Save the file as a new file (File / Save as..) called BOOT2000.ini in the same directory as the boot.ini file and then close the BOOT2000.ini file. If you're curious and would like some insight on the syntax used in the boot.ini file, please read the following. If not, please skip to step 6. Special thanks to Grogan for the contribution. ARC Naming Convention multi(0)disk(0)rdisk(0)partition(2)\WINNT="Microsoft Windows 2000 Professional" /fastdetect The first parameter will be multi for IDE or for a disk on a SCSI controller that has a BIOS. For a disk on a non-bootable SCSI card that doesn't have a BIOS, the scsi syntax will be used instead, in which case it reads the ntbootdd.sys file from the root of C: which is merely the SCSI miniport driver renamed. The reason for this is that the devices on the SCSI controller without a BIOS cannot be initialized without a driver. The number in brackets? Microsoft calls that "the ordinal" and that confuses the living snot out of people. For this one, it's the number of the hardware adapter (e.g. SCSI controller for bootable SCSI, or IDE Controller). The first adapter to load and initialize is 0, the second would be 1. The second parameter disk is the SCSI bus number (SCSI ID). If you're using multi, it's always a value of (0). The third parameter rdisk is the "ordinal" of the disk, or in English, the number of the disk. This is normal, the first hard disk is 0 and a second hard disk would be 1 (i.e. ide0 and ide1). If this is a SCSI disk, this parameter is ignored, i.e. it will be zero. partition is obvious, but it starts at 1. There's no such thing as partition 0, the first partition on a hard disk is partition (1). Thus, in our example, the WINNT directory is on the first IDE controller, on the first disk, on the second partition. http://support.microsoft.com/support/kb/articles/Q102/8/73.ASP 6 - Copying the Windows 98 boot information Go back to the Advanced tab, select Startup and Recovery again. In the system startup section, select Windows 98 as the Default operating system. Hit Ok. Open boot.ini again in the text editor and you should now see: [boot loader] timeout=10 default=C:\ [operating systems] C:\="Microsoft Windows" multi(0)disk(0)rdisk(0)partition(2)\WINNT="Microsoft Windows 2000 Professional" /fastdetect Save the file as a new file (File / Save as) called BOOT98.ini in the same directory as the boot.ini file and then close the BOOT98.ini file. Take a moment to see what is in the boot98.ini and boot2000.ini files, comparing the changes. Batch files We're all done with the System Properties dialog, so close that out. Now we have to set up a way to get the boot info into the boot.ini file when we want to swap the OS. To do this, we'll use batch files to overwrite the boot.ini file. A batch file (*.bat) is simply a list of commands to be carried out by the operating system when called upon. They make life a little easier by allowing the user to group numerous or repetitious commands in one easy to use file. 1 - Open the text editor again and enter the following lines: attrib -r -h -s boot.ini copy boot98.ini boot.ini attrib +r +h +s boot.ini 2 - Save it as (File / Save as..) WIN98.bat in the same directory as your boot.ini files. In this batch file, we are telling the system to remove the attributes that are set to the boot.ini file so we can alter it. The -r removes the Read-only flag, -h removes the Hidden flag and the -s removes the System file flag. copy command (used as copy [source file] [destination file]) will copy the contents of the boot98.ini file into the boot.ini file, overwriting it completely. Finally, the second attrib resets the file attribute flags to their defaults. We do this so we don't accidentally delete or alter the boot.ini unless we intend to. 3 - Create another text file and enter: attrib -r -h -s boot.ini copy boot2000.ini boot.ini attrib +r +h +s boot.ini 4 - Save it as (File / Save as..) WIN2000.bat in the same directory as the WIN98.bat file. Ok, so we've backed up our boot.ini file, right? If not, go do it now, because we're now ready to test the batch files. The following sequence should be done without any rebooting in between. If for some reason you find your batch files not working properly, make sure you copy the boot.bak back to boot.ini before your next power down or rebooting. 5 - Run (double-click) WIN98.bat to verify it works. You should now see a quick DOS window emerge and disappear. Open the boot.ini file and it will have the Windows 98 boot sequence available. 6 - Run (double-click) WIN2000.bat to verify it works. Again, you should see a quick DOS window emerge and disappear. Open the boot.ini file and it will have the Windows 2000 boot sequence available. Shortcuts - Win2K So now we can toggle between OSs by selecting the appropriate batch file. Let's make life even easier and create some shortcuts. 1 - Right-click Win98.bat and select Send to -> Desktop. 2 - Repeat with Win2000.bat There should be two ugly batch icons on your desktop (little gear in the middle). I renamed mine (Right-click -> Rename -> 98 and 2000 appropriately. Go a little further and change the icons to something else if you'd like (Right-click -> Properties -> Change Icon). The last thing I did in Win2K was to drag the 98 and 2000 icons to the Start button and drop them, adding them to the top of the Start menu. I then deleted the ones from the desktop. This is of course optional, I just like having a fairly clean desktop, and this allows you to run the toggle via shortcut keys. If you do opt for the Start menu option, try this sequence: CTRL + ESC, 9, or CTRL + ESC, 2. As long as these are the only "9" & "2" shortcuts in your start menu, you should see the batch files run. Reboot to Win98 Ok, so we're all set up to toggle within Win2K. Time to boot into Win98 and do the shortcuts from there. Go ahead and click the Win98 shortcut you've made to set the default to Win98. Reboot the computer. As my coffee is cold and I don't have to worry about being at the terminal to select Win98, I'm going to go reheat my drink and finish this in Win98. Shortcuts - Win98 From Win98, we are going to make shortcuts just like we did in Win2K. The steps are almost the same, so let's get going. 1 - Go to your C:\ drive again (assuming that's where your new boot files are) and we should see: Boot.ini; Boot98.ini; Boot2000.ini; Win98.bat; Win2000.bat 2 - Just like in Win2000, right click the Win98.bat file and select Send to -> Desktop. 3 - Repeat with Win2000.bat Close the C:\ window and go to the desktop. The Win2000 and Win98 shortcuts that are here need a little more care than the ones created in 2000 4 - Right-click the Win2000 shortcut and select Properties / Program. 5 - Place a check in the Close On Exit box. We really shouldn't care what size the DOS windows is run in, so Normal Window is fine. A cleaner approach would be Minimized, but that's at your discretion and that can be changed under the Screen tab. 6 - While we're here let's change the less than sightly MS DOS icon. Choose Change icon to select a new icon. To keep things looking alike, I browsed over to the Win2000 Shell32.dll file (D:\WINNT\SYSTEM32\Shell32.dll, yours may vary). Just search for SHELL32.DLL under your WINNT directory and select the same icons I used in 2000. 7 - Hit Apply and then Ok when you're done. Repeat for the Win98 shortcut and again, as in Win2K, you can drag the Win98 and Win2000 shortcuts to the Start button and drop them, adding them to the top of the Start menu if you like. If so, just deleted the ones from the desktop. Summary Now you have a set of toggles in both OSs and can change your boot sequence from within either OS. To change the default OS, simply double-click the appropriate shortcut and reboot. If you keep Win98 for gaming, it's as simple as clicking the Win2000 shortcut when you're done with your game, and the next time you boot, you'll be in Win2K. Hopefully this will make switching back and forth a little easier for everyone. http://www.PCNineOneOne.com