码迷,mamicode.com
首页 > 数据库 > 详细

Windows 7,8中"is not accessible"的问题(应用程序默认配置文件存储位置)

时间:2015-05-14 12:08:34      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:windows   权限   配置文件   

Windows 7, 8用户在访问ProgramData目录和Documents and Settings目录时,会无法打开并被提示“C:\xxxx is not accessible. Access is denied.”因为权限不足而被拒绝访问。这是因为在Windows Vista以后的Windows操作系统中,默认的应用程序数据位置相对于使用广泛的Windows XP已经被修改了,而这几个目录之所以存在时为了兼容还试图访问它们的老程序。

它涉及了Documents and Settings和ProgramData下的所有文件,其中包括配置目录,缓存目录等等。

你完全不需要去使用某些工具或命令来获取这些目录的访问权限,因为我们可以很方便地去它们对应的路径来访问它们。

只是换了个位置

在Windows XP下默认保存用户数据(我的文档,我的音乐等)和应用程序配置,应用程序数据(Local Settings,Application Data等)被放在“Documents and Settings”目录下,自Windows Vista开始,包括Windows 7,Windows 8, Windows 8.1 以及还未正式发布的Windows 10,微软对这个目录结构左右一定的优化(简化目录名称并去除空格,减小目录深度,调整部分内容的划分方式),使之更加易用和合理。

大体上,是讲它们转移到了C:\User目录下。我在后面会给出完整的列表。
可能比较常用的是:

  • C:\Documents and Settings\ username \Local Settings\ 变为 C:\Users\ username \AppData\Local\
  • C:\Documents and Settings\ username \Application Data\ 变为 C:\Users\ username \AppData\Roaming\

站在开发者的角度上“数据”和“配置”的划分有时候会比较模糊,但是变为“本地数据”和“可漫游数据”就好理解的多了。简单的说:假设一个有网络同步功能的RPG游戏,我分别在两台配置不同的机器上玩,不同机器我配置了不同的画面特效级别,它们就是只作用于本地的配置文件,而我的游戏进度则是应该漫游在各个机器上的数据。

权限

为了兼容性考虑,微软还保留了名为ProgramData,Documents and Settings等的几个Junction Point(类似Linux的硬链接,没有接触过这个概念的朋友就当做是快捷方式好了),但是由于目录的替换是完整的一一映射(用户可以按照新方式找到所有文件),而且从微软的角度也不希望用户在去使用旧的划分方式,所以微软将默认情况下将它们的read权限设置为Everyone - Deny.

  • 想看完整的Junction Point列表吗?用管理员权限打开一个cmd,在系统盘输入 dir /aL /s

完整对应表

Parent folder junction requirements:

Directory junction creation location Destination
..\Documents and Settings\ ..\Users\

User data legacy folder junction requirements:

Directory junction creation location Destination
..\Documents and Settings\username\My Documents ..\Users\username\Documents
..\Documents and Settings\username\My Documents\My Music ..\Users\username\Music
..\Documents and Settings\username\My Documents\My Pictures ..\Users\username\Pictures
..\Documents and Settings\username\My Documents\My Videos ..\Users\username\Videos

Per-user Application Data legacy folder junction requirements:

Directory junction creation location Destination
..\Documents and Settings\username\Local Settings\ ..\Users\username\AppData\Local
..\Documents and Settings\username\Local Settings\Application Data ..\Users\username\AppData\Local
..\Documents and Settings\username\Local Settings\Temporary Internet Files ..\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files
..\Documents and Settings\username\Local Settings\History ..\Users\username\AppData\Local\Microsoft\Windows\History
..\Documents and Settings\username\Application Data\ ..\Users\username\AppData\Roaming

Per-user OS settings legacy folder junction requirements:

Directory junction creation location Destination
..\Documents and Settings\username\Cookies\ ..\Roaming\Microsoft\Windows\Cookies
..\Documents and Settings\username\Recent ..\Roaming\Microsoft\Windows\Recent
..\Documents and Settings\username\Nethood\ ..\Roaming\Microsoft\Windows\Network Shortcuts
..\Documents and Settings\username\Printhood\ ..\Roaming\Microsoft\Windows\Printer Shortcuts
..\Documents and Settings\username\SendTo\ ..\Roaming\Microsoft\Windows\Send To
..\Documents and Settings\username\StartMenu\ ..\Roaming\Microsoft\Windows\StartMenu
..\Documents and Settings\username\Templates\ ..\Roaming\Microsoft\Windows\Templates

Legacy profile folders where junctions are not required:

Legacy location Reasoning
..\Documents and Settings\username\Desktop Covered by the junction at Documents and Settings
..\Documents and Settings\username\Favorites Covered by the junction at Documents and Settings
..\Documents and Settings\username\Local Settings\Temp Covered by the junction for the Local Settings folder to Local

All Users legacy folder junction requirements:

Sym links creation location Destination
..\Users\All Users ..\ProgramData

User junction points:

Directory junction creation location Destination
..\ProgramData\Desktop ..\Users\Public\Desktop
..\ProgramData\Documents ..\Users\Public\Documents
..\ProgramData\Favorites ..\Users\Public\Favorites
..\Users\Public\Documents\My Music ..\Users\Public\Music
..\Users\Public\Documents\My Pictures ..\Users\Public\Pictures
..\Users\Public\Documents\My Videos ..\Users\Public\Videos
..\ProgramData\Application Data\ ..\ProgramData
..\ProgramData\Start Menu\ ..\ProgramData\Microsoft\Windows\StartMenu
..\ProgramData\Templates\ ..\ProgramData\Microsoft\Windows\Templates

Default User legacy folder junction requirements:

Directory junction creation location Destination
..\Documents and Settings\Default User ..\Users\Default
..\Documents and Settings\Default User\Desktop ..\Users\Default\Desktop
..\Documents and Settings\Default User\My Documents ..\Users\Default\Documents
..\Documents and Settings\Default User\Favorites ..\Users\Default\Favorites
..\Documents and Settings\Default User\My Documents\My Music ..\Users\Default\Music
..\Documents and Settings\Default User\My Documents\My Pictures ..\Users\Default\Pictures
..\Documents and Settings\Default User\My Documents\My Videos ..\Users\Default\Videos
..\Documents and Settings\Default User\Application Data\ ..\Users\Default\AppData\Roaming
..\Documents and Settings\Default Users\Start Menu\ ..\Users\Default\AppData\Roaming\Microsoft\Windows\StartMenu
..\Documents and Settings\Default User\Templates\ ..\Users\Default\AppData\Roaming\Microsoft\Windows\Templates

Program Files junction points:

Directory junction creation location Destination
..\Program Files (Localized name) ..\Program Files
..\Program Files\Common Files (Localized Name) ..\Program Files\Local Files

参考资料:

Windows 7,8中"is not accessible"的问题(应用程序默认配置文件存储位置)

标签:windows   权限   配置文件   

原文地址:http://blog.csdn.net/yanxiangtianji/article/details/45717555

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!