How to create a FileFolder in Windows?
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?
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:
- Create a folder that you want to turn into your FileFolder.
- Create a shortcut to the target folder named
target.lnk
inside your FileFolder -
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
-
Set the "Read Only" attribute for the file folder using
attrib
from the command lineattrib +r "FileFolder"
-
(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.
I found out why things aren't working. All steps I did were correct except for one: Giving my folder a +r attribute.
Using explorer to set the read-only attribute is not working on folders it seems.
But when using attrib Filefolder +r suddenly explorer started to understand, and things work.
So the easiest way now is to first create the folder and attrib it, then create the appropriate files inside.
So:
C:\>md FileFolder
C:\>attrib FileFolder +r
C:\>cd FileFolder
C:\FileFolder>start .
Now from the explorer window, create a desktop.ini with the following content:
[.ShellClassInfo]
CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}
Flags=2
Make sure the desktop.ini has an enter after the Flags=2, otherwise its still not working.
And right-click New
> Shortcut
, point it to where it has to go, and name it target
Now, Go up a directory, and you'll notice the icon has a shortcut arrow on it, yet it is a folder. Clicking on it will properly redirect.
Note: It may take up to a minute for the shortcut to start working.
EDIT: Additionally, providing your shortcut with a different icon will allow that icon to be shown in your shortcutfolder too.