API which can give me All Users/Current User directory path

API which can give me All Users/Current User directory path

Post by S2FtYW » Sat, 02 Jun 2007 13:47:03


Hello All,

Iam confused where to post this question as I did not get the proper forum
where I can post a query related to Windows APIs.
I need to know an API which can give me the All Users/Current User
directory. The path of these directories will be "C:\Documents and
Settings\All Users" for Current User it will be "C:\Documents and
Settings\Current User Name". Please let me know if there is an API which can
give me the path of these directories as I cannot hardcode it in the program.

Thanks,
Kamal
 
 
 

API which can give me All Users/Current User directory path

Post by Gary Chans » Sat, 02 Jun 2007 21:31:45


can
program.

GetEnvironmentVariable(USERPROFILE,...) and
GetEnvironmentVariable(ALLUSERSPROFILE,...).

--

- Gary Chanson (Windows SDK MVP)
- Abolish Public Schools