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

Bob Scho#4 / 5

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

Scott Earnes#5 / 5

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