Solved

How to get the real bootdrive?

Posted on 1997-07-31
9
267 Views
Last Modified: 2012-05-04
Hi,

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,

ABEL
0
Comment
Question by:abel
[X]
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
9 Comments
 
LVL 1

Expert Comment

by:olx
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?
0
 
LVL 2

Expert Comment

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

Expert Comment

by:olx
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.  


0
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

by:abel
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.

Remains unanswered: HOW TO GET VIA WINDOWS 95/NT THE REAL BOOTDRIVE ON WHICH LOGO.SYS (startup-logo) IS.

Any answer/comment will be still welcome

Thanks for your efforts
0
 
LVL 5

Expert Comment

by:y96andha
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.
0
 
LVL 39

Author Comment

by:abel
ID: 1429107
Thanks,

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!

Thanks

ABEL
0
 
LVL 1

Expert Comment

by:olx
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)



0
 
LVL 7

Accepted Solution

by:
tward earned 160 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!
0
 
LVL 39

Author Comment

by:abel
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.

ABEL.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

737 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