Location of %allusersprofile% folder in Windows Vista?

29.4k Views Asked by At

What is the exact path to %allusersprofile% folder in Windows Vista? On some systems, I have seen the folder as 'c:\Users\All Users', on some it is mapped to 'C:\ProgramData', while on others it has been mapped to 'C:\Users\Public'.

If you can provide link to microsoft documentation reference would be highly helpful (so far I have been unable to dig the link out).

Edit: Registry settings do define the location of the folder. What I am looking for is more towards how Windows interprets/defines these folders at installation time? What is the default location of this folder as defined by Microsoft Windows Vista?

3

There are 3 best solutions below

3
On BEST ANSWER

This document on MSDN shows the new methods in Vista to locate known folders, including the one you ask about specifically: "C:\Documents and Settings".

I gather this can be changed simply by changing the registry (and moving the current directory).

1
On

I found these special folder location confusing sometimes. I created a sheet comparing the folder locations on Windows XP and Vista. That may be useful to you. Here is the link.

2
On

Why do you care? Just use the environment variable (or the KnownFolderId, that's guaranteed to work forever.

Microsoft might decide tomorrow to move the directory to another location - as long as you continue to use the environment variable you'll be ok.

If you hard code the value, your code will break in the future.