Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save perXautomatik/2c62f04be475504ddcd5d29e1e8a518c to your computer and use it in GitHub Desktop.
How to create a FileFolder in Windows? - Super User

Windows has the ability to create shortcuts. When you do, they appear as shortcuts in the files section of a folder. To create one, you right click, new, shortcut, or copy and paste as shortcut amonst other options.

However, windows also has something called a FileFolder, which is a shortcut that is treated like a folder, rather than a file. So with sorting, it appears in the folders location, it appears in the folderviewpane and from the addressbar.

Now, there's also the symbolic links, which is similar to FileFolders, but one thing a symbolic link cannot do, is be placed on a network share and point to a folder on your local computer that is not shared, and if you open that link from a different computer, it opens on their computer instead, like a normal shortcut would do.

A way to create a FileFolder is to use the Add a network location wizard and link to it.

So far I figured out that the location of this FileFolder is:

%AppData%\Microsoft\Windows\Network Shortcuts

Opening this folder in command prompt allows me to debug how this folder is made.

It is a regular folder, not a file. Performing an attrib shows me this:

C:\....\Roaming\Microsoft\Windows\Network Shortcuts>attrib /d /s
   SH        C:\....\Roaming\Microsoft\Windows\Network Shortcuts\test\desktop.ini
A            C:\....\Roaming\Microsoft\Windows\Network Shortcuts\test\target.lnk
     R       C:\....\Roaming\Microsoft\Windows\Network Shortcuts\test

So a Folder without archive or system attribute set, but with read only, which contains a normal target.lnk (the shortcut to where it points) and a desktop.ini with system and hidden attribute set but not archive, to glue it all together.

The content of desktop.ini shows me:

[.ShellClassInfo]
CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
Flags=2

I can rename the desktop.ini to desktop.ini~ and then navigate the folder with explorer. Deleting the target.lnk file and right-click new->shortcut and point it to something, then name it target and renaming desktop.ini~ back to desktop.ini succesfully alters the target, and I can succesfully copy/move the new FileFolder.

[You don't need to set the attributes of the files in the folder. You just need to make sure that the "FileFolder" is read-only.

](https://superuser.com/posts/1114281/timeline)

Here are the steps to creating a "FileFolder" manually:

  1. Create a folder that you want to turn into your FileFolder.

  2. Create a shortcut to the target folder named target.lnk inside your FileFolder

  3. Copy the desktop.ini file from a previously created FileFolder to your new FileFolder, or create a new text file called "desktop.ini" inside your FileFolder with these contents

    [.ShellClassInfo]
    CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
    Flags=2
    
  4. Set the "Read Only" attribute for the file folder using attrib from the command line

    attrib +r "FileFolder"
    
  5. (Optional) Set the attributes of both files to "Hidden" and "System"

    attrib +h +s "desktop.ini"
    attrib +h +s "target.lnk"
    

That should create a "FileFolder" that immediately redirects you to another folder when opened in Windows Explorer.

Url: https://superuser.com/questions/1114114/how-to-create-a-filefolder-in-windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment