>>The same for WinNT.
>>
>>Vlad
>>
>>>For W95 you can do GETENV('WINDIR').
>
>I used the GETENV('WINDIR') and it worked on both Win95 and My NT, but when I move it out to the client (NT Server I dial into), it kept coming back "". I opened the properties on the clints "My Computer" and under environment, it listed windir as d:\winnt, but the GETENV('WINDIR') kept returning blank, I am going to try the dll calls that Ed sent.
NT Server should return a value for GETENV('WINDIR') natively; is it possible that you're not running in a console session of the NT Server machine? At least, that's the case if I run VFP6 from the console. NT should return a much more fully populated environment for a default VM. The only cases where it isn't the case is if (1) the buffer to receive the path isn't big enough (it returns a value of zero) or (2) the VFP session is started in a way that doesn't inherit the environment of the parent (e.g. VFP6 is started by an invocation of CreateProcess() that points to an environment block not containing a value for WINDIR), or the parent didn't have WINDIR defined. The API calls should always resolve, since both the Windows directory and the System directory are a part of the search path for Win32.