Musings of a PC

Thoughts about Windows, TV and technology in general

Tag Archives: DFSN

How to hide shared folders under DFS Namespaces

There is a very well known “trick” to hide shares with Windows and that is to put a $ sign at the end of the share name. The problem is that this doesn’t work if you are using DFS Namespaces (DFSN).

The reason why it doesn’t work is because DFSN doesn’t advertise shares – it advertises folders and there is an underlying mechanism to transparently redirect computers trying to connect to those folders to the underpinning shares.

So if you have folders in your DFS Namespace that you want to hide just as if they were a share, how do you do it?

The answer lies in the fact that they are, indeed, folders. Go to the DFSN root server and open up the folder for your namespace. Right-click on the folder you want to hide and choose Properties. Then select the Hidden attribute and click OK. You will be asked if you want to apply the change to this folder only or to this folder, subfolders and files. You only need to apply the change to this folder only.

Be mindful of the fact, though, that this trick of hiding the folders only works so long as users aren’t showing hidden files and folders on their computers. If they are, these folders will still show up.

To make it even harder for users to find these “hidden” folders, it is necessary to set the System attribute on the folder. This then prevents the folders from being seen unless the user has unticked “Hide protected operating system files”.

Setting the system attribute on a folder requires the use of the attrib command with a very specific sequence of flags:

attrib –r +h +s <folder path>

The –r flag removes the read-only setting which is normally used by Windows on folders as an indicator that the folder might have customisation on it. Since we are talking about folders in the DFS Namespace, that isn’t going to apply here.

The +h flag applies the hidden setting. You need to do this as part of the same command as +s in order to make sure that the folder does actually get hidden and not just set as a system folder. You cannot apply the hidden flag after the folder has got the system flag set.

The +s flag applies the system setting.