Question
How do I prevent macOS from creating .DS_Store files on network volumes?
Overview
Hidden .DS_Store (short for Desktop Services Store) files are created in any folders accessed by Macs. .DS_Store files are a proprietary Apple file type that store custom attributes of a folder, such as the position of icons or the choice of a background image. Though these files are small and hidden from normal view, they can cause unwanted clutter.
Answer
To Prevent .DS_Store files from being created on network volumes:
- Launch the Terminal Application
- Enter the following command in Terminal
sudo defaults write /Library/Preferences/com.apple.desktopservices DSDontWriteNetworkStores true
- Reboot
At this point current user and new users will no longer create .DS_Store files when network volumes are accessed from that Mac.