Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetWindowsDirectory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00291459
Message ID:
00291491
Vues:
21
>>>>>There is little I can find on this WIN32API function as it pertains to anything other than C++. Any thoughts as to its arguments or an alternative means to achieving the same result? The aim is to get the "windows" directory.Thank you in advance.
>>>>
>>>>There's an entry in the FAQ that I wrote, FAQ#7806, that gives an exact implementation of this in VFP. It's under Win32 and Other APIs
>>>
>>>And there's also GETENV('WINDIR'). However, I don't know if it's reliable under NT.
>>
>>GETENV() works, but IMO is not the preferred method to use, since the environment variable can be changed by batch files or scripts. It's particularly suspect when issued from a spawned process, where the parent process may have mucked with the environment inherited by the child.
>
>I agree (as you might expect). The only thing I'd say is that any process (outside of Windows) that fools with this environment variable should be immediately relegated to the "bit-bucket". There are a lot of "ill-behaved" programs out there, but this would take that phrase to a different level of meaning< g >.

Agreed, but it's often accidental. For example, both CreateProcess() and ShellExecuteEx() have the ability to define a new environment name space to pass to a child process. Not everyone reads the docs, and they don't realize that you have to load the entire environment namespace; the new environment, if specified, is not passed with along with the new one...
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform