Prevent .DS_Store files from being created…

Question: Is there a way to prevent Mac OS X creating .DS_Store and other hidden meta-files on foreign volumes like NTFS and FAT? I share an NTFS partition with data like Thunderird & Firefox’s profiles and apache’s DocumentRoot, between Mac OS X and Windows, which is very handy. I don’t mind if Mac OS X is not capable of indexing or otherwise doing the neat things those metafiles are for.

Answer: To configure a Mac OS X user account so that .DS_Store files are not created when interacting with a remote file server using the Finder, follow the steps below:

Note: This applies to any SMB/CIFS, AFP, NFS or WebDAV connections to a server.

  1. Open Terminal (located in the Utilities folder).
  2. Execute this command:

    defaults write com.apple.desktopservices DSDontWriteNetworkStores true

    This terminal command is case sensitive, so be careful with your upper/lower casing.

  3. Either restart the computer or log out and back in to the user account.

This is user specific, so If you want to prevent .DS_Store file creation for other users on the same computer, log in to each user account and perform the steps above—or distribute a copy of the newly modified com.apple.desktopservices.plist file to the ~/Library/Preferences folder of other user accounts.