Hello,
How can I retrieve the %USERPROFILE%\Local Settings\Application Data directory?
Thanks,
Marc
Local Settings\Application Data directory
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Dear Marc,
You can use GetEnv() as in Clipper function.
You can use GetEnv() as in Clipper function.
Code: Select all
GETENV("USERPROFILE")
*------------------------*
Function GetEnv(VarString)
Local OutBuf:=space(200),VarLen:=0
VarLen:=GetEnv2(ALLTRIM(VarString),Outbuf,200)
* If the value return is greater than the initial buffer we have to increase
* it to receive the value but I limit the length to 3000
if VarLen > 200 .and. VarLen <=3000
Outbuf:=SPACE(VarLen)
GetEnv2(ALLTRIM(VarString),Outbuf,Varlen)
elseif VarLen > 3000
MSGINFO("Can't retrieve, the value is too long")
VarLen:=0
endif
Return Left(OutBuf,Varlen)
DLL32 FUNCTION GetEnv2( lpName AS LPSTR, lpBuffer AS LPSTR, nSize AS DWORD) ;
AS DWORD PASCAL FROM "GetEnvironmentVariableA" LIB "Kernel32.DLL"
-
- Posts: 1102
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact: