Windows – How to Create a File Folder

shortcutswindowswindows-explorer

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.

The question

Now the thing is, I can succesfully modify a filefolder that works, but I can't seem to figure out how to manually create one from scratch. Eg: Right mouse->New folder, Give attributes, Inside create the appropriate files.

I go to the previous folder and back in, and I just see the desktop.ini and target.lnk instead of getting redirected.

Does anyone know why it doesn't work, or what steps I need to take to make it work?

Best Answer

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.

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.

Related Question