示例:在中创建新文件夹Application Data

示例:在中创建新文件夹Application Data

在我的用户文件夹中,( C:\Users\user) 有一堆符号链接不会显示在文件资源管理器中,即使启用了 show>hidden 也是如此。我之所以注意到它们,是因为我在 VS Code 中打开了我的文件夹。如果我尝试通过在文件资源管理器中输入其路径来打开一个文件夹,它会显示以下弹出窗口。
拒绝访问弹出窗口
我可以Set-Location在管理员中对它们进行操作pwsh,但如果我尝试Get-ChildItem,它会说
Get-ChildItem: Access to the path 'C:\Users\user\Application Data' is denied.
在管理员中cmddir输入它们会返回

 Volume in drive C is Windows
 Volume Serial Number is B426-88EF

 Directory of C:\Users\user\Application Data

File Not Found

以下是链接列表:

Application Data
Cookies
Local Settings
My Documents
NetHood
PrintHood
Recent
SendTo
Start Menu
Templates

(我还没有尝试打开所有这些,只打开了几个。如果我应该尝试某个特定的,请在评论中说出来)

...所以我的问题是:这些是怎么回事?它们是一些遗留问题吗?超级管理员权限是怎么回事?

答案1

微软在 Windows Vista/Windows Server 2008 中引入了新的文件夹结构,出于向后兼容性的原因,他们决定用连接点替换所有已移动的文件夹。

在这里阅读更多内容:
https://learn.microsoft.com/en-us/windows/win32/vss/junction-points

连接点的文件夹和文件无法列出,您只能使用其完整路径直接访问或创建/保存/编辑文件或文件夹。原因是连接点的 ACL。 在此处输入图片描述

示例:在中创建新文件夹Application Data

New-Item "$Env:USERPROFILE\Application Data\test" -Type Directory

创建文件夹%AppData%\test

示例:列出现有子目录中的目录Application Data

Get-ChildItem "$Env:USERPROFILE\Application Data\Microsoft"

列表%AppData%\Microsoft

示例:我的电脑上的其他连接点和符号链接

以下 PS 命令将C:\Users\All Users递归列出所有连接点以及符号链接(如,可以无权限问题进行访问)。

Get-ChildItem C:\ -Force -Attributes ReparsePoint+System+Hidden -Recurse | 
    ? { $_.FullName -notlike 'C:\Windows.old*' } | Select LinkType, FullName, Target

LinkType     FullName                                                                                          Target
--------     --------                                                                                          ------
Junction     C:\Documents and Settings                                                                         C:\Users
Junction     C:\ProgramData\Application Data                                                                   C:\ProgramData
Junction     C:\ProgramData\Desktop                                                                            C:\Users\Public\Desktop
Junction     C:\ProgramData\Documents                                                                          C:\Users\Public\Documents
Junction     C:\ProgramData\Start Menu                                                                         C:\ProgramData\Microsoft\Windows\Start Menu
Junction     C:\ProgramData\Templates                                                                          C:\ProgramData\Microsoft\Windows\Templates
SymbolicLink C:\Users\All Users                                                                                C:\ProgramData
Junction     C:\Users\Default User                                                                             C:\Users\Default
Junction     C:\Users\Default\Application Data                                                                 C:\Users\Default\AppData\Roaming
Junction     C:\Users\Default\Cookies                                                                          C:\Users\Default\AppData\Local\Microsoft\Windows\INetCookies
Junction     C:\Users\Default\Local Settings                                                                   C:\Users\Default\AppData\Local
Junction     C:\Users\Default\My Documents                                                                     C:\Users\Default\Documents
Junction     C:\Users\Default\NetHood                                                                          C:\Users\Default\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Junction     C:\Users\Default\PrintHood                                                                        C:\Users\Default\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Junction     C:\Users\Default\Recent                                                                           C:\Users\Default\AppData\Roaming\Microsoft\Windows\Recent
Junction     C:\Users\Default\SendTo                                                                           C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo
Junction     C:\Users\Default\Start Menu                                                                       C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu
Junction     C:\Users\Default\Templates                                                                        C:\Users\Default\AppData\Roaming\Microsoft\Windows\Templates
Junction     C:\Users\Default\AppData\Local\Application Data                                                   C:\Users\Default\AppData\Local
Junction     C:\Users\Default\AppData\Local\History                                                            C:\Users\Default\AppData\Local\Microsoft\Windows\History
Junction     C:\Users\Default\AppData\Local\Temporary Internet Files                                           C:\Users\Default\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files                         C:\Users\Default\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\Default\Documents\My Music                                                               C:\Users\Default\Music
Junction     C:\Users\Default\Documents\My Pictures                                                            C:\Users\Default\Pictures
Junction     C:\Users\Default\Documents\My Videos                                                              C:\Users\Default\Videos
Junction     C:\Users\defaultuser0\Application Data                                                            C:\Users\defaultuser0\AppData\Roaming
Junction     C:\Users\defaultuser0\Cookies                                                                     C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\INetCookies
Junction     C:\Users\defaultuser0\Local Settings                                                              C:\Users\defaultuser0\AppData\Local
Junction     C:\Users\defaultuser0\My Documents                                                                C:\Users\defaultuser0\Documents
Junction     C:\Users\defaultuser0\NetHood                                                                     C:\Users\defaultuser0\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Junction     C:\Users\defaultuser0\PrintHood                                                                   C:\Users\defaultuser0\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Junction     C:\Users\defaultuser0\Recent                                                                      C:\Users\defaultuser0\AppData\Roaming\Microsoft\Windows\Recent
Junction     C:\Users\defaultuser0\SendTo                                                                      C:\Users\defaultuser0\AppData\Roaming\Microsoft\Windows\SendTo
Junction     C:\Users\defaultuser0\Start Menu                                                                  C:\Users\defaultuser0\AppData\Roaming\Microsoft\Windows\Start Menu
Junction     C:\Users\defaultuser0\Templates                                                                   C:\Users\defaultuser0\AppData\Roaming\Microsoft\Windows\Templates
Junction     C:\Users\defaultuser0\AppData\Local\Application Data                                              C:\Users\defaultuser0\AppData\Local
Junction     C:\Users\defaultuser0\AppData\Local\History                                                       C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\History
Junction     C:\Users\defaultuser0\AppData\Local\Temporary Internet Files                                      C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\Temporary Internet Files                    C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\INetCache\Content.IE5                       C:\Users\defaultuser0\AppData\Local\Microsoft\Windows\INetCache\IE
Junction     C:\Users\defaultuser0\Documents\My Music                                                          C:\Users\defaultuser0\Music
Junction     C:\Users\defaultuser0\Documents\My Pictures                                                       C:\Users\defaultuser0\Pictures
Junction     C:\Users\defaultuser0\Documents\My Videos                                                         C:\Users\defaultuser0\Videos
Junction     C:\Users\Public\Documents\My Music                                                                C:\Users\Public\Music
Junction     C:\Users\Public\Documents\My Pictures                                                             C:\Users\Public\Pictures
Junction     C:\Users\Public\Documents\My Videos                                                               C:\Users\Public\Videos
Junction     C:\Users\svenw\Application Data                                                                   C:\Users\svenw\AppData\Roaming
Junction     C:\Users\svenw\Cookies                                                                            C:\Users\svenw\AppData\Local\Microsoft\Windows\INetCookies
Junction     C:\Users\svenw\Local Settings                                                                     C:\Users\svenw\AppData\Local
Junction     C:\Users\svenw\My Documents                                                                       C:\Users\svenw\Documents
Junction     C:\Users\svenw\NetHood                                                                            C:\Users\svenw\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Junction     C:\Users\svenw\PrintHood                                                                          C:\Users\svenw\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Junction     C:\Users\svenw\Recent                                                                             C:\Users\svenw\AppData\Roaming\Microsoft\Windows\Recent
Junction     C:\Users\svenw\SendTo                                                                             C:\Users\svenw\AppData\Roaming\Microsoft\Windows\SendTo
Junction     C:\Users\svenw\Start Menu                                                                         C:\Users\svenw\AppData\Roaming\Microsoft\Windows\Start Menu
Junction     C:\Users\svenw\Templates                                                                          C:\Users\svenw\AppData\Roaming\Microsoft\Windows\Templates
Junction     C:\Users\svenw\AppData\Local\Application Data                                                     C:\Users\svenw\AppData\Local
Junction     C:\Users\svenw\AppData\Local\History                                                              C:\Users\svenw\AppData\Local\Microsoft\Windows\History
Junction     C:\Users\svenw\AppData\Local\Temporary Internet Files                                             C:\Users\svenw\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\svenw\AppData\Local\Microsoft\Windows\Temporary Internet Files                           C:\Users\svenw\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\svenw\AppData\Local\Microsoft\Windows\INetCache\Content.IE5                              C:\Users\svenw\AppData\Local\Microsoft\Windows\INetCache\IE
Junction     C:\Users\svenw\Documents\My Music                                                                 C:\Users\svenw\Music
Junction     C:\Users\svenw\Documents\My Pictures                                                              C:\Users\svenw\Pictures
Junction     C:\Users\svenw\Documents\My Videos                                                                C:\Users\svenw\Videos
Junction     C:\Users\Test\Application Data                                                                    C:\Users\Test\AppData\Roaming
Junction     C:\Users\Test\Cookies                                                                             C:\Users\Test\AppData\Local\Microsoft\Windows\INetCookies
Junction     C:\Users\Test\Local Settings                                                                      C:\Users\Test\AppData\Local
Junction     C:\Users\Test\My Documents                                                                        C:\Users\Test\Documents
Junction     C:\Users\Test\NetHood                                                                             C:\Users\Test\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Junction     C:\Users\Test\PrintHood                                                                           C:\Users\Test\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Junction     C:\Users\Test\Recent                                                                              C:\Users\Test\AppData\Roaming\Microsoft\Windows\Recent
Junction     C:\Users\Test\SendTo                                                                              C:\Users\Test\AppData\Roaming\Microsoft\Windows\SendTo
Junction     C:\Users\Test\Start Menu                                                                          C:\Users\Test\AppData\Roaming\Microsoft\Windows\Start Menu
Junction     C:\Users\Test\Templates                                                                           C:\Users\Test\AppData\Roaming\Microsoft\Windows\Templates
Junction     C:\Users\Test\AppData\Local\Application Data                                                      C:\Users\Test\AppData\Local
Junction     C:\Users\Test\AppData\Local\History                                                               C:\Users\Test\AppData\Local\Microsoft\Windows\History
Junction     C:\Users\Test\AppData\Local\Temporary Internet Files                                              C:\Users\Test\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\Test\AppData\Local\Microsoft\Windows\Temporary Internet Files                            C:\Users\Test\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Users\Test\Documents\My Music                                                                  C:\Users\Test\Music
Junction     C:\Users\Test\Documents\My Pictures                                                               C:\Users\Test\Pictures
Junction     C:\Users\Test\Documents\My Videos                                                                 C:\Users\Test\Videos
Junction     C:\Windows\ServiceProfiles\MariaDB\Application Data                                               C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming
Junction     C:\Windows\ServiceProfiles\MariaDB\Cookies                                                        C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Local\Microsoft\Windows\INetCookies
Junction     C:\Windows\ServiceProfiles\MariaDB\Local Settings                                                 C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Local
Junction     C:\Windows\ServiceProfiles\MariaDB\My Documents                                                   C:\WINDOWS\ServiceProfiles\MariaDB\Documents
Junction     C:\Windows\ServiceProfiles\MariaDB\NetHood                                                        C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Junction     C:\Windows\ServiceProfiles\MariaDB\PrintHood                                                      C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Junction     C:\Windows\ServiceProfiles\MariaDB\Recent                                                         C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming\Microsoft\Windows\Recent
Junction     C:\Windows\ServiceProfiles\MariaDB\SendTo                                                         C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming\Microsoft\Windows\SendTo
Junction     C:\Windows\ServiceProfiles\MariaDB\Start Menu                                                     C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming\Microsoft\Windows\Start Menu
Junction     C:\Windows\ServiceProfiles\MariaDB\Templates                                                      C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Roaming\Microsoft\Windows\Templates
Junction     C:\Windows\ServiceProfiles\MariaDB\AppData\Local\Application Data                                 C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Local
Junction     C:\Windows\ServiceProfiles\MariaDB\AppData\Local\History                                          C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Local\Microsoft\Windows\History
Junction     C:\Windows\ServiceProfiles\MariaDB\AppData\Local\Temporary Internet Files                         C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Windows\ServiceProfiles\MariaDB\AppData\Local\Microsoft\Windows\Temporary Internet Files       C:\WINDOWS\ServiceProfiles\MariaDB\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Windows\ServiceProfiles\MariaDB\Documents\My Music                                             C:\WINDOWS\ServiceProfiles\MariaDB\Music
Junction     C:\Windows\ServiceProfiles\MariaDB\Documents\My Pictures                                          C:\WINDOWS\ServiceProfiles\MariaDB\Pictures
Junction     C:\Windows\ServiceProfiles\MariaDB\Documents\My Videos                                            C:\WINDOWS\ServiceProfiles\MariaDB\Videos
Junction     C:\Windows\ServiceProfiles\UIFlowService\Application Data                                         C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming
Junction     C:\Windows\ServiceProfiles\UIFlowService\Cookies                                                  C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Local\Microsoft\Windows\INetCookies
Junction     C:\Windows\ServiceProfiles\UIFlowService\Local Settings                                           C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Local
Junction     C:\Windows\ServiceProfiles\UIFlowService\My Documents                                             C:\WINDOWS\ServiceProfiles\UIFlowService\Documents
Junction     C:\Windows\ServiceProfiles\UIFlowService\NetHood                                                  C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Junction     C:\Windows\ServiceProfiles\UIFlowService\PrintHood                                                C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Junction     C:\Windows\ServiceProfiles\UIFlowService\Recent                                                   C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming\Microsoft\Windows\Recent
Junction     C:\Windows\ServiceProfiles\UIFlowService\SendTo                                                   C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming\Microsoft\Windows\SendTo
Junction     C:\Windows\ServiceProfiles\UIFlowService\Start Menu                                               C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming\Microsoft\Windows\Start Menu
Junction     C:\Windows\ServiceProfiles\UIFlowService\Templates                                                C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Roaming\Microsoft\Windows\Templates
Junction     C:\Windows\ServiceProfiles\UIFlowService\AppData\Local\Application Data                           C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Local
Junction     C:\Windows\ServiceProfiles\UIFlowService\AppData\Local\History                                    C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Local\Microsoft\Windows\History
Junction     C:\Windows\ServiceProfiles\UIFlowService\AppData\Local\Temporary Internet Files                   C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Windows\ServiceProfiles\UIFlowService\AppData\Local\Microsoft\Windows\Temporary Internet Files C:\WINDOWS\ServiceProfiles\UIFlowService\AppData\Local\Microsoft\Windows\INetCache
Junction     C:\Windows\ServiceProfiles\UIFlowService\Documents\My Music                                       C:\WINDOWS\ServiceProfiles\UIFlowService\Music
Junction     C:\Windows\ServiceProfiles\UIFlowService\Documents\My Pictures                                    C:\WINDOWS\ServiceProfiles\UIFlowService\Pictures
Junction     C:\Windows\ServiceProfiles\UIFlowService\Documents\My Videos                                      C:\WINDOWS\ServiceProfiles\UIFlowService\Videos
Junction     C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\Content.IE5    C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\IE

相关内容