views:

4152

answers:

3

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?

A: 

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).

paxdiablo
Thanks for the link. I am doing some research and need information on how Windows decides the location of the folder upon installation. Registry is written only after Windows Vista has taken a decision.
Sandy
If it's not documented, then you can't rely on it. One of the major reasons software companies keep a lot of this stuff undocumented is because once it's published, you can't change it without annoying a LOT of people. You need to ask MS - maybe Raymond Chen could help, but I suspect he'd give you the same advice - you may well find out, but it will not be reliable :-)
paxdiablo
I had already put forward the question through MSDN and am still awaiting reply :(
Sandy
+1  A: 

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.

Hemant
Thanks for the sheet. But, I am looking for documentation as to how Windows decide where to map these folders to, upon installation. The entries you have made are already as in the registry settings (see previous answer).
Sandy
+3  A: 

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.

Larry Osterman
The reason I care for is because the application would be running in a sandbox environment, and won't have access to system registry or the system environment variables.
Sandy
I'd use the KnownFolderId suggestion inside your sandbox.
Larry Osterman