Location of %allusersprofile% folder in Windows Vista?

人盡茶涼 提交于 2019-12-10 10:05:09

问题


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?


回答1:


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




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/784487/location-of-allusersprofile-folder-in-windows-vista

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!