To disable the creation of .ds_store files, launch the Terminal application from /Applications/Utilities/ and enter the following command string exactly:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Reboot the Mac for changes to take full effect.