Retrieve C:\Documents and Settings\<profilename>

Retrieve C:\Documents and Settings\<profilename>

Postby Ollie » Tue May 01, 2007 4:21 pm

C:\Documents and Settings\<profilename>\Application Data\Microsoft\Stationery

What is the function to retrieve the <profilename> as in the path above?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby StefanHaupt » Wed May 02, 2007 7:32 am

Ollie,

you can read the environment

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local cValue := Space( 256 )

//  MsgInfo( GetEnv( "USERPROFILE" ) )
   
   GetEnvironmentVariable( "USERPROFILE", cValue, Len( cValue ) )
   
   MsgInfo( cValue )
   
return nil

DLL32 FUNCTION GetEnvironmentVariable( cName AS LPSTR, ;
                                         cValue AS LPSTR, nLen AS LONG ) ;
   AS LONG PASCAL FROM "GetEnvironmentVariableA" LIB "kernel32.dll" 


Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests