How to get the real bootdrive?

Posted on 1997-07-31
Medium Priority
Last Modified: 2012-05-04

I need to know the ABSOLUTE bootdrive Windows 95 or Windows NT uses. I need it for being able to automatically change the startup logo (logo.sys in the bootdirectory, if not there, it's in io.sys) of Windows. When there's only one disk, it's in C:\, when there's a doublespacedrive, it's usually H:\, but, if not, it's possible to get it from C:\drives.dat. (when windir is subdir of c:, otherwise: ?:\drives.dat.) DRIVES.DAT comes up as soon as DRVSPACE or DBLSPACE is loaded via Windows.
But where to find it when there are more (primary) partitions, more drives and the bootdrive is (for example) c:\ and windows is in d:\windows and/or there's also a doublespace host? Maybe the combination of getting HostWinBootDrv out of MSDOS.SYS (but I'm not sure what HostWinBootDrv means in absolute sense) and doublespace drive out of DRIVES.DAT (hopefully in the rootdrive mentioned in MSDOS.SYS) is enough. I cannot tell for sure and I haven't got enough test-cases to try all the possibilities. When you have documentation on how to get the drive/directory I need to put LOGO.SYS in, please tell me. I want to know it and it has to be proof for every situation with win95/winNT.

Please, help me out,

Question by:abel
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1429102
Let me understand

* You are making a Vb Program that must be able to change the logo.sys file located into the windows dir of some drive that could be in any hard disk.
* You need to locate the file and do what it needs to, no matter if the hd is with TroubleSpace or Stacker or something else

i am right?

Expert Comment

ID: 1429103
has olx said use the DIR command to locate the logo.sys file and them change it.

Expert Comment

ID: 1429104
In any pc system the boot drive is c: allways, no matter how many drives or partitions you have.  If your app is a win app (i am sure it is) you can get the windows system directory with no problems at all.  

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 39

Author Comment

ID: 1429105
Sorry, but what you say is partly true. It is possible to create another bootdrive then C:. I know, because I've tried it. With dblspace it's a little bit different. Dblspace creates a huge file with it's own structure in the bootdrive. It acts H: (or another drive) is your boot and c: is your logical working drive, and windows' startup-logo (usually in c:) is now in H:(not really off course, but when your computer has booted, it is). So far so good. I can trace down the H:-drive (even when it has another driveletter). With more REAL logical drives it's more difficult. I don't know where to find the drives then, because I haven't tested it. It's not that easy, since the place where you boot does not have to be the same place where the windows-dir is (that is tracable via GetWindowsDir).

Answer to olx: With more partitions or more drives it IS possible (quite easy actually) to have more bootdrives. The first sector will be read from c: (the master-drive), but with an optional boot-menu, you can start the rest of your boot from another drive. That is quite normal if you have Unix/Linux, (MS)DOS, Windows (95) and/or any other combination of OS's on your system.


Any answer/comment will be still welcome

Thanks for your efforts

Expert Comment

ID: 1429106
In Windows NT: Use the SystemDrive environment string to get the drive that NT loads files from. The boot drive is always C: in Windows NT.
LVL 39

Author Comment

ID: 1429107

Most computers the program will run on are Windows 95 computers. I have finally made a testcase with a D:-partition (Windows 95 on D:, C: was doublespaced and host of C: was H:). Conclusion, the way I mentioned does not work. I need to know some other way to find out the drive which should contain IO.SYS and perhaps, when there's a new logo, the startup LOGO.SYS file. The problem with doublespaced drives is that they have a IO.SYS in C: and H:. I just don't know how to figure out (in code) how to get the real bootdir I need for LOGO.SYS.
On Windows NT I will try the proposal of y96andha, although I'm not certain that the boodrive is ALWAYS C:. Theoratically and practically it's possible to have a multiple/dual boot-system, even with NT. That means that the drive after the first startup will change and the boot continues on another drive. I know a few systems which have a dual boot, but I don't have permission to use them, so I can't test things there. I will continue trying to find it on my own system by reconfiguring the partition table, but that takes a lot of time.
If someone knows or hears a solution I will be very thankfull!



Expert Comment

ID: 1429108
the comspec environment var points to the command shell processor, it maybe helps you.  Normally (people not running special configurations like you said with dual boot)

¿Is there a problem if you check en c:\ d:\ e:\ f:\ g:\ h:\ for this file?
¿Is there the posibility to put an option saying "DEAR USER, PLEASE INDICATE YOUR BOOT DRIVE: _____ "? (while you get the answer to do this via code)


Accepted Solution

tward earned 640 total points
ID: 1429109
Check the following in the Registry:

My Coumputer\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup

Key:  BootDir = "C:\"

This should get the Boot Drive For you!
LVL 39

Author Comment

ID: 1429110
I've tried to find some documentation of that key in "Special Ed. Using the Windows 95 Registry" by J. Honeycutt (which is - I think - one of the most comprehensive databases about the Registry) but found little usefull information. I've tried it a few times, and it seems to work! I'm not completely sure since the documentation is so short about it. I've tried it with quite unusual configurations and it still works. So, many thanks to you, Tward. I greatly appreciate this one since it seems to be the absolute booting dir (so far). When it won't work, I'll fire my question again, but I think we're finally on the right way to go.

Thanks again.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question