[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


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.  

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 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