Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting C:\winnt or c:\Windows or D:\winnt
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00169861
Message ID:
00171008
Views:
58
>>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform