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

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


参考资料:

时间: 2024-08-30 12:41:12

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

隐藏windows任务栏中的窗口显示

在实际应用中遇到类似下列需要: 隐藏windows窗口,在windows任务栏中窗口不可见,但应用程序在后台运行. windows应用程序的窗口默认会在任务栏中添加一个可见的窗口项,方便用户操作和在不同应用程序中切换. 考虑到windows操作系统是基于shell的,查找shell的接口资料会发现 ITaskbarList interface .ITaskbarList提供了AddTab和DeleteTab函数,用于向任务栏中添加删除窗口项. 第一种方法就是使用ITaskbarList接口,在程

Windows系统Unity3D中的快捷键

[狗刨学习网] Windows系统Unity3D中的快捷键[td] 组合键 键 功能 File 文件 Ctrl   N New Scene 新建场景 Ctrl   O Open Scene 打开场景 Ctrl   S Save Scene 保存 Ctrl Shift S Save Scene as 保存场景为 Ctrl Shift B Build Settings... 编译设置... Ctrl   B Build and run 编译并运行 Edit 编辑 Ctrl   Z Undo 撤消 C

Windows PowerShell 会话中使用 FSharp 代码编译器

<# $fSharpCode= @" moduleTest let HelloWorld = "Hello World!!!!" printfn "%s" HelloWorld let rec Loop n = seq [ if n <= 0 then () else yield n; yield! Loop (n-1) ] |> Seq.sort printfn "%A" (Loop 5) let rec facto

Windows Store 应用中获取程序集版本号的方法

本文为个人博客备份文章,原文地址: http://validvoid.net/windows-store-app-get-assembly-version/ WinRT 中对反射做了很多限制,假设 Windows Store 应用引用了一个程序集 MyApp.Utils,其中有一个类叫做 MyUtils,可以使用以下方法获得程序集 MyApp.Utils的版本号和文件版本号. 获得程序集版本号 方法一 using System.Reflection; public static string G

Windows Store App 中使用Scrollviewer实现缩放功能

Windows Store App中可以直接使用Scrollviewer实现缩放功能,基本代码如下: <ScrollViewer Background="Yellow" HorizontalScrollBarVisibility="Visible" MaxZoomFactor="2" MinZoomFactor="0.5" VerticalScrollBarVisibility="Visible" Z

在windows 2008 R2中SQl Server 2008中代理启动失败的一个原因总结

启动SQL代理的时候报错如下: 关调用实时(JIT)调试而不是此对话框的详细信息,请参见此消息的结尾. ************** 异常文本 **************System.NullReferenceException: 未将对象引用设置到对象的实例. Server stack trace: 在 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.FindObjectExplore

【转载】Windows 10 mobile中无法注册后退键的解决方法

文章来源:http://wiki.9uads.com/?p=268 在做Windows Universal开发的时候,发现很多Windows Phone 8.1的api不能调用了,包括获取手机后退键的HardwareButtons.客户端设备信息EasClientDeviceInformation等,只需要在VS2015中添加 Microsoft Mobile Extension SDK for Universal App Platform 引用即可,方法如下图: 1.在项目中右键添加引用2.在

缺少一个Windows Mobile设备中心所需要的Windows组件 Activesync4.5安装问题

我在windows server 2008系统上安装 ActiveSync win7下载v6.1 中文安装版(64位)时, 会弹出对话框提示缺少一个Windows Mobile设备中心所需要的Windows组件的问题. 因为你的Windows server  2008系统没有开启桌面体验功能,所以会发生这个问题. 开启桌面体验功能的方法如下: 一.单击"开始"菜单→"运行"命令,输入"services.msc"并回车打开"服务"

Windows Server 2012中的多元密策略

在Windows Server 2008就已经可以使用多元密码策略的,但使用起来很不方便,但到了Windows Server 2012中就简单多了,至于什么是多元密码策略以及在Windows Server 2008中怎么使用大家可以可以去看看我以前的博客:http://yupeizhi.blog.51cto.com/3157367/1549873 1.新建两个测试用户"test1"和"test2": 2.打开"Active Directory 管理中心&q