Stop .DS_Store Files on Network Shares and USB Drives
Write DSDontWriteNetworkStores and DSDontWriteUSBStores so Finder skips creating .DS_Store on non-local volumes.
01Command
$ defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true && defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true02What it does
Finder writes .DS_Store to remember folder view settings, icon positions and window geometry; on shared NAS folders these invisible files show up for Windows users and pollute sync tools. The com.apple.desktopservices keys tell Finder to skip local .DS_Store creation on network and USB volumes while keeping the behavior on your internal disk. Existing .DS_Store files are not deleted — clean them separately (e.g. find … -name .DS_Store -delete).
03Risk
04Undo
$ defaults delete com.apple.desktopservices DSDontWriteNetworkStores && defaults delete com.apple.desktopservices DSDontWriteUSBStores05Sources
- macOS setup dotfiles (.macos)Evidence: Contains 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true' and DSDontWriteUSBStores with comments about avoiding .DS_Store litter on network and USB volumes.
- macOS defaults - read, write and delete macOS user defaultsEvidence: Shows `defaults write domain key -bool value` for per-domain preference keys such as com.apple.desktopservices, with `defaults delete` to revert.
Last verified: 2026-09-19 · Category: Files & Folders
06Related solutions
Make Finder display .pdf, .docx, .png and every other extension at all times.
Point macOS screen captures at any folder you choose instead of the desktop.
List the biggest files in your home folder that are eating disk space.