Windows 7 kept creating a $RECYCLE.BIN dir on the network share. This in itself is merely annoying, but there were also errors resulting from it. Whenever a file would be deleted, this message would appear (translated from dutch): “The recycle bin is damaged, do you want to delete the contents?” Everything froze until that question was answered.
Samba has an option “veto files” which can be used to stop the creation of that directory. Put this in each share’s section in your smb.conf:
veto files = /*$RECYCLE.BIN/
The slashes are not directory separators in this case. Also, I don’t know if the preceeding * is necessary, but it does no harm.