How do I get a letter of the boot drive? Actually I want to read/modify the boot.ini file. So, how should I know on which disk it is located?
Posted on 2002-06-19 05:43:22 by marcinbu
I think boot.ini is always on the c: drive.
Posted on 2002-06-19 06:15:19 by gfalen
Not always - I have WinXP on my first physical drive and Win2K on the second. Boot.ini is on the 1st and when I boot into XP it is drive C, however if I boot into 2K - 2nd physical drive becomes C and boot.ini is then on drive D.
Posted on 2002-06-19 06:17:40 by marcinbu
Do you mean win2k does'nt see c: and maps d: to c:?
Posted on 2002-06-19 06:29:51 by gfalen
Win2k installation was run under Win98 installed on 2nd drive. The 1st drive is NTFS, so Win2k setup didn't see it. Yeah, it's strange to me, too. The boot always begins with 1st hard drive (boot.ini is only on this drive) and deoending on which system I choose one of the drives becoms C and the other D.
Posted on 2002-06-19 08:55:47 by marcinbu
So is the "real" c: visible in 2000? If not you can't access boot.ini anyway.

Forgive me - ypu're setup is a bit confusing.
Posted on 2002-06-19 08:59:14 by gfalen
Maybe GetWindowsDirectory would be what you want. I realize that if your booting from DOS that this won't work but for windows this maybe do. You just have to parse for the drive letter.

best regards,

Posted on 2002-06-19 10:20:58 by czDrillard
What do you mean by the 'real' C? The configuartion goes like this: there are two hard drives - 1st - NTFS connected to primary IDE channel and 2nd - FAT32 connected to secondary IDE channel. Boot.ini is located on the 1st drive and it allows me to either boot into XP (installed on the 1st drive) or to 2K (installed in the 2nd drive). If I boot to XP, the 1st drive gets C letter and the seconf gets D. However, if I boot to 2K, the 2nd drive is called C and the 1st - D. Don't ask me why it is so - I have no idea, I would be very happy if my 1st HDD always were called C...
Posted on 2002-06-19 10:38:18 by marcinbu
iirc on both 2k and XP you can manually assign drive letters...
find diskmgmt.msc and execute it, you should be able to rightclick
partitions and "change drive letter and path".
Posted on 2002-06-19 10:42:57 by f0dder
@f0dder: it doesn't work... :( I can change drive letters under XP but they alraedy are the way they should be and under 2K I get the message "Can't change letter of system/boot drive" and the case is, that one of my drives is the boot drive and the other - system drive.

@czDrillard: GetWindowsDirectory will give me the system drive letter and I need the *boot* drive letter which is the same on most computers but not on mine.

Still, there must be some way to get the boot drive letter from Windows. :confused:
Posted on 2002-06-19 11:08:50 by marcinbu
You probably thought of this already and you want a more "professional" solution - but - how about you just check the root of each drive until you find boot.ini?
Posted on 2002-06-19 11:22:18 by gfalen
:) Yeah, I though about it but what if there are two boot.ini files on two different drives? How do I know which one was used to boot the system?

Anyways, until I find some 100% solution I will have to stick to this method. Perhaps I will first check if there is a boot.ini file on drive C and if not check all available drives...
Posted on 2002-06-19 11:29:28 by marcinbu
I think you will find there is only one boot.ini - located on the first physical drive. The boot loader reads this to load the system. It is Win2K which THEN remaps the drive letters.

Bottom line is it should work.
Posted on 2002-06-19 11:33:19 by gfalen
Suppouse I have one hard drive with XP installed on it. Then, somebody gives me his HDD 'cause he wants me to copy some files for him. He also have XP installed of course. I connect his HDD to my system, thus I get two boot.ini files on two different drives. What then?
Posted on 2002-06-19 12:24:29 by marcinbu
Since you can also boot from a floppy or boot from a CDROM --
and with the use of something like System Commander you
can have DOS 95 98 nt 2k xp linux etc all on the same machine and the BIOS can be used to change the booting process --
may I ask what is it you wish to accomplish? So I may help if possible. Thanks.
Posted on 2002-06-19 21:37:16 by Roy Cline

Look in the following registry key:

HKEY_LOCAL_MACHINE\Device\SystemPartition\HarddiskVolume1 // == c:\, HarddiskVolume2 == d:\ ....

Or, even easier:


Hope this helps!

Posted on 2002-06-20 00:47:21 by bazik
:) Yeah! This is exactly what I was looking for - 1000x Thanx!
Posted on 2002-06-20 04:18:40 by marcinbu