windows 任何用户都可以访问 %APPDATA% 文件夹吗

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7617594/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:47:38  来源:igfitidea点击:

Can any user access the %APPDATA% folder

windows

提问by user593747

Can any user access the %APPDATA% folder? Or can only administrators read & access that directory? Also, do the permissions to access this directory differ over different Windows platforms from 2k to Windows 7?

任何用户都可以访问 %APPDATA% 文件夹吗?还是只有管理员才能读取和访问该目录?此外,从 2k 到 Windows 7 的不同 Windows 平台上访问此目录的权限是否有所不同?

回答by David Pope

You can see the permissions on %APPDATA% by using the icaclstool at the command prompt. Here's what it looks like on my machine:

您可以icacls在命令提示符下使用该工具查看 %APPDATA% 的权限。这是我的机器上的样子:

C:\Users\davidp>icacls %APPDATA%
C:\Users\davidp\AppData\Roaming NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
                                BUILTIN\Administrators:(I)(OI)(CI)(F)
                                MACHINE09\davidp:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files

What this means is that only I, administrators, and the system itself can see the folder. If you run this on a folder where other users can see it, you'll see something like this:

这意味着只有我、管理员和系统本身才能看到该文件夹​​。如果您在其他用户可以看到的文件夹上运行它,您将看到如下内容:

C:\Users\davidp>icacls c:\
c:\ BUILTIN\Administrators:(F)
    BUILTIN\Administrators:(OI)(CI)(IO)(F)
    NT AUTHORITY\SYSTEM:(F)
    NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
    BUILTIN\Users:(OI)(CI)(RX)
    NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(M)
    NT AUTHORITY\Authenticated Users:(AD)
    Mandatory Label\High Mandatory Level:(OI)(NP)(IO)(NW)

Successfully processed 1 files; Failed processing 0 files

You can see that the BUILTIN\Usersgroup can see the c:\folder (as you would expect).

您可以看到该BUILTIN\Users组可以看到该c:\文件夹(如您所料)。

EDIT

编辑

I'm not sure how far back the %APPDATA% variable itself goes back in Windows history. I recommend checking directly. On older systems the caclscommand was the predecessor to icacls. Regardless, in Windows NT-based OSes there has always been a profile area visible only to the user and administrators.

我不确定 %APPDATA% 变量本身在 Windows 历史中可以追溯到多远。我建议直接检查。在较旧的系统上,该cacls命令是icacls. 无论如何,在基于 Windows NT 的操作系统中,始终有一个仅对用户和管理员可见的配置文件区域。

回答by Mahmoud Al-Qudsi

%AppData% is a user-specificpath. Yes, any user can access %appdata%, but it will go to a different directory for each user. Only an administrator can read the appdata of another user.

%AppData% 是用户特定的路径。是的,任何用户都可以访问 %appdata%,但它会为每个用户访问不同的目录。只有管​​理员才能读取其他用户的应用数据。

Do the effort of actually going to %appdata% on your machine, and looking at the path it gets converted into. Do you see what I mean?

努力在您的机器上实际访问 %appdata% 并查看它转换成的路径。你明白我的意思吗?