3

So I am writing an application that iterates through a specified directory tree and I was experimenting with the exception that handles permissions for folder access and there was one folder I came across that the compiler returned that had the directory of C:\ProgramData\Application Data

Does anyone know what this folder is? It doesn't seem to exist within Windows Explorer. Like, the folder isn't there. It's not hidden. It just isn't there. I was able to get inside the folder using an elevated command prompt but when I used the "dir" command to see what the folder contained, CMD returned:

"Directory of C:\ProgramData\Application Data

File Not Found"

I am curious to know what this folder is.....

  • See e.g. http://stackoverflow.com/questions/9518890/what-is-the-significance-of-the-programdata-folder-in-windows – Marvin Jul 11 '15 at 01:16

1 Answers1

5

The dir /a command is your friend here:

C:\ProgramData>dir /a
 Volume in drive C has no label.
 Volume Serial Number is 848A-BBB7

 Directory of C:\ProgramData

23/05/2015  03:38 pm    <DIR>          .
23/05/2015  03:38 pm    <DIR>          ..
14/05/2015  10:28 pm    <JUNCTION>     Application Data [C:\ProgramData]

As you can see, Application Data is a junction point which points back to ProgramData. Windows includes a number of similar junction points, for backwards compatibility with older applications.

The security permissions on the junction point explicitly prohibit listing files, which is why you can't get a listing of its contents:

C:\ProgramData>icacls "Application Data" /L
Application Data Everyone:(DENY)(S,RD)
                 Everyone:(RX)
                 NT AUTHORITY\SYSTEM:(F)
                 BUILTIN\Administrators:(F)

Also, the junction point is marked System and Hidden:

C:\ProgramData>attrib /L "Application Data"
   SH   I    C:\ProgramData\Application Data

which is why Explorer doesn't show it. (It appears that Explorer does not show junction points marked hidden and system, even if configured to show hidden items.)

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
  • 1
    Its just that setting "show system files" from GUI is broken in explorer. If you tick it and go see registry settings, it is still 0 in registry. You need to manually set it to 1 to show system files in explorer. I made custom C++ program that can toggle hidden/superhidden files with just right click on empty folder space. – ScienceDiscoverer Jul 20 '22 at 12:55