HT1629: Mac OS X v10.4 and later: How to prevent .DS_Store file creation over network connectionsLearn about Mac OS X v10.4 and later: How to prevent .DS_Store file creation over network connections
Currently Being ModeratedSep 30, 2012 11:31 AM (in response to liskabadabiska)
Open the Script Editor or AppleScript Editor in one of the subfolders of Applications and run the following:
tell application "Finder" to quit
if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is "1" then
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
tell application "Finder" to run
If you change your mind later, run the script again.
Currently Being ModeratedSep 30, 2012 12:02 PM (in response to Niel)
The .DS_STORE file is a file that's a cache. Nothing more. If it doesn't exist, it'll be created.
Niel describes how to get rid of the file and how to reveal or to hide what would otherwise be hidden files using an AppleScript, but you've probably gone to some effort to show those files as that's not a default setting of OS X.
Launching Terminal.app and issuing the defaults write command directly is also feasible, and there are tools that enable these and other settings. Given you're seeing the file, you've probably already used a related command or tool, as you would not otherwise be seeing the file.
Currently Being ModeratedDec 2, 2012 5:38 PM (in response to jayxtee)
The .ds_store cache file is a so-called hidden file.
If you don't want to see hidden files, then you will turn off the ShowAllFiles knob.
There's no knob specifically for .ds_store.
The sequence is described above for AppleScript, or you can launch Applications > Utilities > Terminal.app and enter:
defaults write com.apple.finder AppleShowAllFiles 0
Currently Being ModeratedMar 26, 2013 6:15 PM (in response to MrHoffman)
I'm unfamiliar with the terminal app, but I'm sure I can run it. Can I copy and paste "defaults write com.apple.finder AppleShowAllFiles 0" in the program to prevent OSX, I'm running 10.8.3 on a MacBook, from writing the .ds_store on my desktop?
Currently Being ModeratedMar 28, 2013 11:53 AM (in response to Lloydfsd)
The "defaults write com.apple.finder AppleShowAllFiles 0" setting does not control whether .ds_store is written, it controls whether it (and other hidden files) are visible in Finder. There is no knob to disable .ds_store.
What's your goal here? Not showing the file in Finder? Sure. Launch Terminal.app from Applications > Utilities, paste in the command, and you're good to go. Finder won't show any hidden files.
Not (ever) generating the .ds_cache file? No way to do that, short of not (ever) using Finder with the directory, and that's not feasible with the Desktop. Finder creates that file when it's looking at the directory.
Currently Being ModeratedMay 11, 2013 8:17 AM (in response to liskabadabiska)
Type this into the terminal application that can be found in spotlight and press enter ... Gone ....Type this :
defaults write com.apple.finder AppleShowAll Files FALSE; killall Finder