Prevent creation of .DS_Store files on network shares

One thing that can be problematic when working with any shared storage is the existence of .DS_Store files on the network share, since these are intended for a single workstation’s use.

Enabling a policy to prevent the creation of .DS_Store files on network shares can speed up directory browsing (as described in this article) and prevent permission errors when moving/deleting files.

To prevent the Mac workstation from creating .DS_Store files on network shares, as well as instruct it to ignore existing .DS_Stores, open Terminal and enter:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

and then log out/log in the macOS user account, or simply reboot the workstation.

To check the current policy in place, enter:

defaults read com.apple.desktopservices

If .DS_Store files are disallowed for network shares, “DSDontWriteNetworkStores = 1” should be displayed.

Note: To remove this policy and restore the default behavior, enter

defaults delete com.apple.desktopservices DSDontWriteNetworkStores