Search code examples
c#.netdirectoryuniqueidentifier

Unique Folder Identifier


Earlier today someone generously answered my question regarding the retrieval of a unique identifier associated with files on the computer. Unique File Identifier

The solution worked great, however, it does not address unique identifiers for folders. How can I retrieve a UID for specified directories, UID's that will stay with the directory through renames and moves.

Update: FSCTL_GET_OBJECT_ID seems like it is the function I am after, but would someone be able to provide brief context on the usage? Thanks!


Solution

  • I put this into an answer, because it was too much text for a comment.

    I answered your question regarding Unique File Identifiers. I didn't dig in too deep into this topic. That's been just good researching skills.

    I researched a bit and collected some documentation links that may help you:

    I've been searching for quite a time, but I couldn't find anything which identifies each folder, regardless of its path.

    The only folders, which always can be identified - as far as I know, yet - are these known folders. That's because one WinOS uses the C:/winnt/Windows Net/ and another one uses D:/Windows/Net/ path (don't look up those, I just made them up off the top of my head).