Windows – How to stop $RECYCLE.BIN from being created (or hide it) on network drives/folders

cifsrecycle-binwindows 7

I have a Windows 7 desktop which has 3 drive mappings to CIFS shares on a FreeBSD home server. There are also special folders (Desktop, etc) stored on the CIFS shares.

Each of these (including the special folders for some reason) has its own Recycle Bin settings, which I've configured such that the Recycle Bin is not used. However, I see a $RECYCLE.BIN folder created on my desktop every time I delete a file anywhere on my computer (including local disks which also have the Recycle Bin disabled) which is rather annoying.
Inside this folder is always a desktop.ini. Normally I can't see other desktop.ini files on the local drives as I have protected OS files hidden.

I can't hide the folder as CIFS doesn't seem to store the hidden or system attributes (thus why I'm seeing the desktop.ini files also) despite telling the client to treat dotfiles as hidden.

Best Answer

In the smb.conf file you have the ability to hide files from directory listings.

In the share you are concerned with add something like:

hide files = /desktop.ini/$RECYCLE.BIN/

which will hide the desktop.ini files and the $RECYCLE.BIN folder.

http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#id2543596

Related Question