Find WIN 95 installation Directory. HOW? 
Author Message
 Find WIN 95 installation Directory. HOW?

Hi,

I need to determine in which directory Windows is running from.

Any suggestion?

Thanks in advance,

EJ



Wed, 18 Jun 1902 08:00:00 GMT  
 Find WIN 95 installation Directory. HOW?


say]--

Quote:
>Hi,
>I need to determine in which directory Windows is running from.

It's \windows on mine, no need to write a program, just ask!

MdP
Veteran of the Bermuda Exploration Venture 1991-1953



Wed, 18 Jun 1902 08:00:00 GMT  
 Find WIN 95 installation Directory. HOW?

Quote:


> say]--

> >Hi,

> >I need to determine in which directory Windows is running from.

> It's \windows on mine, no need to write a program, just ask!

Gee, what a coincidence.  It happens to be \Win on all the systems I've
installed it on (saves on PATH space).  There's a REASON for asking this
question -- namely to make programs capable of adapting to preferred
installations, especially since the drive and/or path can be different.
Some use the default of C:\Windows, but there's nothing from keeping it
installed in c:\Win, C:\Win95, or even D:\W95.

To answer the original question more thoroughly, there's a Windows API
call that will return this information.  Unfortunately, what it is
offhand, I'm not certain.  In Win 3.x, the call is
GetWindowsDirectory(), but I can't find a reference to it in my Win 95
API reference.  But if you're using BPW or TPW with the WinAPI unit,
this may be sufficient.  The formal declaration from the BPW help is:

function GetWindowsDirectory(Buffer: PChar; Size: Word): Word;

I'd suggest going to the on-line help for more information.

Quote:
> MdP
> Veteran of the Bermuda Exploration Venture 1991-1953

--
Scott Earnest        | We now return you to our regularly |



Wed, 18 Jun 1902 08:00:00 GMT  
 Find WIN 95 installation Directory. HOW?

Quote:

> I need to determine in which directory Windows is running from.

     There is an environmental variable called WinDir that should have
this information.  Go to a DOS prompt and type SET.

Bob Schor



Wed, 18 Jun 1902 08:00:00 GMT  
 Find WIN 95 installation Directory. HOW?

Quote:


> > I need to determine in which directory Windows is running from.

>      There is an environmental variable called WinDir that should have
> this information.  Go to a DOS prompt and type SET.

> Bob Schor

Oh!  That reminds me of a way to get this without using the API.  Try
this snippet (not tested, but I think it'll work):

uses
  dos {,...};

function getwindirectory : string;

var
  idx : word;

begin
  getwindirectory := '';
  for idx := 1 to envcount do
    if pos('windir=',envstr(idx))=1 then
      getwindirectory := envstr(idx);
end;

--
Scott Earnest        | We now return you to our regularly |



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Creating Win 3.1 apps/network apps in win 95

2. How do I know DOS program is under Win 95 or Win NT

3. Pascal Compiler for Win 3.1 / Win 95

4. Reportsmith won't print to fax on Win 95

5. BP7.0 for Win under Win 95

6. SQL Server for Win 95 and Win NT?

7. installation BP with object in windows 95

8. installation of bp with objects 7.0 in windows 95

9. BDE installation on Windows 95

10. Help: D1 app with Win 95?

11. Win NT/95 generic SQL*NET Connections

12. Help: MS-DOS Screen Capture (in Full-Screen Mode) Under Win 95/98/NT

 

 
Powered by phpBB® Forum Software