From: Harish on
How can I get the folder name of the logged-in user?
(C:\Documents and Settings\...<user name>...\Local Settings\Application Data)
--Harish



From: Jeroen Mostert on
Harish wrote:
> How can I get the folder name of the logged-in user?
> (C:\Documents and Settings\...<user name>...\Local Settings\Application Data)

SHGetFolderPath(..., CSIDL_LOCAL_APPDATA, ...);


--
J.
From: Coca on
On Jul 14, 5:23 am, Harish <Har...(a)discussions.microsoft.com> wrote:
> How can I get the folder name of the logged-in user?
> (C:\Documents and Settings\...<user name>...\Local Settings\Application Data)
> --Harish

Or call GetEnvironmentVariable with %userprofile% :-)

Coca
From: Mihai N. on
> Or call GetEnvironmentVariable with %userprofile% :-)
There are no guarantees that the environment variable is set.
SHGetFolderPath is the safer option.


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email