Thread View: borland.public.cppbuilder.nativeapi
12 messages
12 total messages
Started by Mike Collins
Tue, 09 May 2006 10:05
locating boot.ini
Author: Mike Collins
Date: Tue, 09 May 2006 10:05
Date: Tue, 09 May 2006 10:05
14 lines
1492 bytes
1492 bytes
Hi all, just a quickie, ive search MSDN and MS newsgroups to no avail so I thought I'd ask the real experts :) I need to load and read some information from boot.ini but I'm faced with the problem of locating it. I can't seem to find any information on if it is always stored on c:\... or if it can reside on other drive letters. Also, I can't find if it's possible to have multiple boot.ini files residing on a machine. Finally does anyone know if there is a particular reg key or apis that specifics / returns the current boot.ini location for the active windows version? Many thanks in advance, Mike C
Re: locating boot.ini
Author: Nathaniel L. Walker
Date: Tue, 09 May 2006 11:33
Date: Tue, 09 May 2006 11:33
26 lines
1857 bytes
1857 bytes
Search helps. start -> search You're welcome. Nate. "Mike Collins" <its@TheBottomOfThePost.com> wrote in message news:44606967@newsgroups.borland.com... > Hi all, just a quickie, ive search MSDN and MS newsgroups to no avail so I > thought I'd ask the real experts :) > > I need to load and read some information from boot.ini but I'm faced with > the problem of locating it. I can't seem to find any information on if it > is always stored on c:\... or if it can reside on other drive letters. > Also, I can't find if it's possible to have multiple boot.ini files > residing on a machine. Finally does anyone know if there is a particular > reg key or apis that specifics / returns the current boot.ini location for > the active windows version? > > Many thanks in advance, > > Mike C >
Re: locating boot.ini
Author: Alan Bellingham
Date: Tue, 09 May 2006 11:48
Date: Tue, 09 May 2006 11:48
13 lines
1181 bytes
1181 bytes
"Nathaniel L. Walker" <NathanielWalker@DontThinkAboutIt.net> wrote: >Search helps. > >start -> search > >You're welcome. Could you explain how a program uses that? Alan Bellingham -- ACCU Conference 2007 - venue to be determined.
Re: locating boot.ini
Author: Ed Mulroy
Date: Tue, 09 May 2006 12:08
Date: Tue, 09 May 2006 12:08
25 lines
2262 bytes
2262 bytes
There may not be such a file. For example, I have no boot.ini on my Windows XP machine. Might boot.ini be only for used the Windows 95/98/ME branch? To find a file on the disk use the FindFirstFile/FindNextFile/FindClose set of Windows functions. That set of functions works on a given directory so to search a while drive, start at the root and for every directory you find then search in it, and so on down the chain. You can get a list of the drives with either of the Windows functions GetLogicalDrives or GetLogicalDriveStrings. . Ed > Mike Collins wrote in message > news:44606967@newsgroups.borland.com... > > Hi all, just a quickie, ive search MSDN and MS newsgroups to no avail so I > thought I'd ask the real experts :) > > I need to load and read some information from boot.ini but I'm faced with > the problem of locating it. I can't seem to find any information on if it > is always stored on c:\... or if it can reside on other drive letters. > Also, I can't find if it's possible to have multiple boot.ini files > residing on a machine. Finally does anyone know if there is a particular > reg key or apis that specifics / returns the current boot.ini location for > the active windows version?
Re: locating boot.ini
Author: Alan Bellingham
Date: Tue, 09 May 2006 13:18
Date: Tue, 09 May 2006 13:18
40 lines
2468 bytes
2468 bytes
"Ed Mulroy" <dont_email_me@bitbuc.ket> wrote: >There may not be such a file. For example, I have no boot.ini on my Windows >XP machine. Might boot.ini be only for used the Windows 95/98/ME branch? Have you checked in c:\? It's not immediately obvious: ------------------------------------------------- C:\>dir boot.ini Volume in drive C is Win2K Volume Serial Number is 84ED-4755 Directory of C:\ File Not Found C:\>attrib boot.ini A SH C:\boot.ini C:\> ------------------------------------------------- >To find a file on the disk use the FindFirstFile/FindNextFile/FindClose set >of Windows functions. That set of functions works on a given directory so >to search a while drive, start at the root and for every directory you find >then search in it, and so on down the chain. You can get a list of the >drives with either of the Windows functions GetLogicalDrives or >GetLogicalDriveStrings. I don't think any recursive option is required - if it's not in the root directory, I don't expect ntldr (or is it ntdetect.com) to bother doing a full scan through all directories. It's reasonable for an OS loader to require vital files to be easily accessible. However, it might possibly be on a volume that's not actually visible to the OS, so I suspect it's not going to be an easy Alan Bellingham -- ACCU Conference 2007 - venue to be determined.
Re: locating boot.ini
Author: Mike Collins
Date: Tue, 09 May 2006 13:27
Date: Tue, 09 May 2006 13:27
38 lines
2737 bytes
2737 bytes
Hi guys, thanks for the replies, sorry if I haven't made my self very clear... I know how to programmable search for a file and how to get the logical drives that are available. What I was primarily wondering was if there was an api like GetSystemDirectory() that I could use to locate the ware abouts of boot.ini. As has been pointed out here, boot.ini does not always exists and it is a hidden file, but it also does not HAVE to exist on c: either. Depending on how this system was set up, it may appear in other drives and I believe that it is possible to have more than one boot.ini on the system. I need to check this file for just that reason i.e. to see if there are any other, working OS's installed. I know that I can recurs through each drive and find this file but I wanted to know if there was any other method. Particular thanks to Nate for that purl... "Mike Collins" <its@TheBottomOfThePost.com> wrote in message news:44606967@newsgroups.borland.com... > Hi all, just a quickie, ive search MSDN and MS newsgroups to no avail so I > thought I'd ask the real experts :) > > I need to load and read some information from boot.ini but I'm faced with > the problem of locating it. I can't seem to find any information on if it > is always stored on c:\... or if it can reside on other drive letters. > Also, I can't find if it's possible to have multiple boot.ini files > residing on a machine. Finally does anyone know if there is a particular > reg key or apis that specifics / returns the current boot.ini location for > the active windows version? > > Many thanks in advance, > > Mike C >
Re: locating boot.ini
Author: Alan Bellingham
Date: Tue, 09 May 2006 13:42
Date: Tue, 09 May 2006 13:42
18 lines
1582 bytes
1582 bytes
"Mike Collins" <its@TheBottomOfThePost.com> wrote: >Depending on how this system was set up, it may appear in other drives and I >believe that it is possible to have more than one boot.ini on the system. Ah, good point. In fact, my home machine does have more than one, a which gets executed depends on which drive is currently the boot drive. And more, they have different contents. No, I'm not aware of any API. I suspect you'll need to know which partition is the bootable one, and then you go look at that. I'd expect Andrue Cope to know most about this. Alan Bellingham -- ACCU Conference 2007 - venue to be determined.
Re: locating boot.ini
Author: Ed Mulroy
Date: Tue, 09 May 2006 14:03
Date: Tue, 09 May 2006 14:03
87 lines
3315 bytes
3315 bytes
You are correct. It is hidden and system. When I did a DIR /S with /as and
with /ah it did not show. After seeing your reply I did it without the /S
and it shows.
----------------------------------------
C:\
>ver
Microsoft Windows XP [Version 5.1.2600]
C:\
>dir boot.ini
Volume in drive C has no label.
Volume Serial Number is FC8D-A209
Directory of C:\
File Not Found
C:\
>dir /ah boot.ini
Volume in drive C has no label.
Volume Serial Number is FC8D-A209
Directory of C:\
06/06/2005 05:27 PM 211 BOOT.INI
1 File(s) 211 bytes
0 Dir(s) 35,302,158,336 bytes free
C:\
>dir /as boot.ini
Volume in drive C has no label.
Volume Serial Number is FC8D-A209
Directory of C:\
06/06/2005 05:27 PM 211 BOOT.INI
1 File(s) 211 bytes
0 Dir(s) 35,302,158,336 bytes free
C:\
>type boot.ini
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP
Professional"
/noexecute=optin /fastdetect
C:\
>
----------------------------------------
> Alan Bellingham wrote in message
> news:m7516298em23gpnb2j9449af89a3csg9gq@4ax.com...
>
>>There may not be such a file. For example, I have no boot.ini
>>on my Windows XP machine. Might boot.ini be only for used
> the Windows 95/98/ME branch?
>
> Have you checked in c:\? It's not immediately obvious:
>
> -------------------------------------------------
> C:\>dir boot.ini
> Volume in drive C is Win2K
> Volume Serial Number is 84ED-4755
>
> Directory of C:\
>
> File Not Found
>
> C:\>attrib boot.ini
> A SH C:\boot.ini
>
> C:\>
> -------------------------------------------------
>
>>To find a file on the disk ...
>
> I don't think any recursive option is required - if it's not in the root
> directory, I don't expect ntldr (or is it ntdetect.com) to bother doing
> a full scan through all directories. It's reasonable for an OS loader
> to require vital files to be easily accessible.
>
> However, it might possibly be on a volume that's not actually visible
> to the OS, so I suspect it's not going to be an easy
Re: locating boot.ini
Author: Remy Lebeau (TeamB)
Date: Tue, 09 May 2006 16:47
Date: Tue, 09 May 2006 16:47
16 lines
1408 bytes
1408 bytes
"Ed Mulroy" <dont_email_me@bitbuc.ket> wrote in message news:446086a1$1@newsgroups.borland.com... > I have no boot.ini on my Windows XP machine. boot.ini is a hidden file. Did you account for that? boot.ini tells bootloader where XP is installed. If the file doesn't exist, bootloader may be using a default value that you just happen to also be using. > Might boot.ini be only for used the Windows 95/98/ME branch? I don't have any boot.ini file on my Win98 SE machine. Gambit
Re: locating boot.ini
Author: Remy Lebeau (TeamB)
Date: Tue, 09 May 2006 16:47
Date: Tue, 09 May 2006 16:47
20 lines
1632 bytes
1632 bytes
"Mike Collins" <its@TheBottomOfThePost.com> wrote in message news:44606967@newsgroups.borland.com... > I need to load and read some information from boot.ini but I'm faced > with the problem of locating it. I can't seem to find any information on > if it is always stored on c:\... or if it can reside on other drive letters. > Also, I can't find if it's possible to have multiple boot.ini files residing > on a machine. Finally does anyone know if there is a particular reg > key or apis that specifics / returns the current boot.ini location for the > active windows version? boot.ini is located at "%homedrive%\boot.ini", where "%homedrive%" is an environment variable that is set to a drive specification, ie "C:", "D:", etc. Gambit
Re: locating boot.ini
Author: Remy Lebeau (TeamB)
Date: Tue, 09 May 2006 16:52
Date: Tue, 09 May 2006 16:52
28 lines
2031 bytes
2031 bytes
"Mike Collins" <its@TheBottomOfThePost.com> wrote in message news:446098c1@newsgroups.borland.com... > What I was primarily wondering was if there was an api like > GetSystemDirectory() that I could use to locate the ware abouts > of boot.ini. There is nothing specific for that. However, since bootini is located at "%homedrive%\boot.ini", you can try using GetEnvironmentVariable() to resolve "%homedrive%" into a physical path. > As has been pointed out here, boot.ini does not always exists and it > is a hidden file, but it also does not HAVE to exist on c: either. Depending > on how this system was set up, it may appear in other drives and I believe > that it is possible to have more than one boot.ini on the system. I need > to check this file for just that reason i.e. to see if there are any other, > working OS's installed. Typically, boot.ini would reside at the root C:\ folder so that the machine can find it before loading any OS, and then the contents of boot.ini tells bootloader which OSes are installed so that bootloader can display a dual-boot menu to the user. Gambit
Re: locating boot.ini
Author: Mike Collins
Date: Tue, 09 May 2006 17:37
Date: Tue, 09 May 2006 17:37
14 lines
1507 bytes
1507 bytes
thanks remy - %homedrive% - i think that is what i'm looking for, will need to experiment a bit first. Thanks again "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:4460c836$3@newsgroups.borland.com... > > "Mike Collins" <its@TheBottomOfThePost.com> wrote in message > news:44606967@newsgroups.borland.com... > >> I need to load and read some information from boot.ini but I'm faced >> with the problem of locating it. I can't seem to find any information on >> if it is always stored on c:\... or if it can reside on other drive
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads