Solved

How to get the real bootdrive?

Posted on 1997-07-31
9
259 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
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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now