Archive: Search Multiple Drives


Search Multiple Drives
Not too sure how to explain what exactly I am looking to do, but I'll do my best to explain it.

The installer that I'm creating has to be able to edit the "boot.ini" file in order to start my application. After first glance this was easy to edit and it was working great. However, the more people that used it, the more I found that this file is not always located at the root of the C:\ drive. I need a way to find this "boot.ini" as it will be located on the active partition of the hard drive.

Is/are there any ways to detect the partitions on a computer and determine which partition is active? From what I've found, it doesn't seem to be easy.

My other thought would be to do a file search on the root of every hard drive detected. This wouldn't be such a problem other than all of the search functions require a path. Can you loop through a list of different hard drives? Any examples?

Or do any of you guys have a better idea that would be more feasible?

Thanks!


Did you try %SYSTEMDRIVE% ?


%SYSTEMDRIVE% is a no-go. It would work great so long as the drive you have Windows installed on is also the active partition. Here 2 examples:

1. 1 hard drive, 1 partition. Everything will be located on your C:\ drive, this includes all boot items.

2. multiple hard drives, multiple partitions. If you install Windows to the D:\ drive, your system drive will be the D:\ drive. However, all of your boot information will be stored on the active partition (most likely the C:\ partition or the partition that is set to active)

Any other ideas?


${GetDrives} I couldn't think of something better.