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?
I think boot.ini is always on the c: drive.
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.
Do you mean win2k does'nt see c: and maps d: to c:?
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.
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.
Forgive me - ypu're setup is a bit confusing.
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,
czDrillard
best regards,
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...
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".
find diskmgmt.msc and execute it, you should be able to rightclick
partitions and "change drive letter and path".
@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:
@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:
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?
:) 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...
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...
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.
Bottom line is it should work.
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?
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.
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.
Hi!
Look in the following registry key:
Or, even easier:
Hope this helps!
bAZiK
Look in the following registry key:
HKEY_LOCAL_MACHINE\Device\SystemPartition\HarddiskVolume1 // == c:\, HarddiskVolume2 == d:\ ....
Or, even easier:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\BootDir
Hope this helps!
bAZiK
:) Yeah! This is exactly what I was looking for - 1000x Thanx!