AllUsers Profile Path

  • Thread starter Thread starter John Bowman
  • Start date Start date
J

John Bowman

Hello,

I need to retrieve the path to the AllUsers profile on W2K/XP. Is there some
standard technique for retrieving this in .NET? I know I could retrieve the
the logged in user's temp path and the logged in user's name and parse out
the user's profile and then tack back on "AllUsers". Isn't there a much
better way?

TIA,
 
You could use something like this:

Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData

Which gets you this:
C:\Documents and Settings\All Users\Application Data

Or on Windows 2000 and Windows XP, you could read the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

The entries there (when concatenated with a "\" between them will give you
the path you want:
AllUsersProfile =
ProfilesDirectory =



Jerry
 
Jerry,

Thanks! Using the Environment.GetFolderPath() is just the ticket. I must
have been looking in all the wrong places for the answer.

John
 
Back
Top