Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SysDir--How to find it?
Message
De
16/04/1999 15:48:50
 
 
À
16/04/1999 13:48:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00209098
Message ID:
00209161
Vues:
20
>>How do I determine what the current Windows\System directory is? Can I use an API call, or is there is VFP command that I'm over looking?
>>
>>Thanks!
>? getenv("windir")+"\system"

Except under NT, where the system directory is the \SYSTEM32 dir. Best to use the API call:
DECLARE INTEGER GetSystemDirectory IN Win32API ;
	STRING  @cLocation, ;
	INTEGER nSize
LOCAL cLocation, nSize

m.cLocation = SPACE(256)
m.nSize = GetSystemDirectory(@cLocation, 256)

IF nSize > 0
	*
	* Got it - it's the size of the return
	*
	cLocation = LEFT(m.cLocation,m.nSize)
ELSE
	*
	*  An error occurred when retrieving the value - return the null string
	*
	cLocation = ''
ENDIF
If you have the Windows Scripting Host, you can use the Wscript.Shell's SpecialFolders collection to retrieve the system directory, and under NT, there's an environment variable available as well.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform