defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Then use the following script to remove every .AppleX file created:
#!/bin/bash
if [ -z "$2" ]
then
echo "Use
fi
if [ -z "$1" ]
then
echo "No arguments supplied"
echo "Use
exit 1
else
find $1 -name .AppleDouble -exec ls -d {} \;
find $1 -name .AppleDesktop -exec ls -d {} \;
find $1 -name .AppleDB -exec ls -d {} \;
fi
if [ "$2" == "--really" ]
then
echo "RUNNING DELETE"
find $1 -name .AppleDouble -exec rm -r {} \;
find $1 -name .AppleDesktop -exec rm -r {} \;
find $1 -name .AppleDB -exec rm -r {} \;
echo "Done. .AppleDouble files obliterated\n"
else
echo "nothing"
fi