Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

.ds_store on desktop

I have a .ds_store icon on my desktop, and I have no idea what it means or how to get it off of there. Whenever I delete it, it just appears again on my desktop right after it goes to my trash can. How can I get rid of it or does it not mean anything? Thanks!

MacBook Pro, OS X Mountain Lion (10.8.2)

Posted on Sep 30, 2012 11:28 AM

Reply
Question marked as Best reply

Posted on Sep 30, 2012 11:31 AM

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"

else

do shell script "defaults write com.apple.finder AppleShowAllFiles 1"

end if

delay 2

tell application "Finder" to run


If you change your mind later, run the script again.


(70312)

13 replies
Question marked as Best reply

Sep 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"

else

do shell script "defaults write com.apple.finder AppleShowAllFiles 1"

end if

delay 2

tell application "Finder" to run


If you change your mind later, run the script again.


(70312)

Sep 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.

Dec 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

Mar 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.

.ds_store on desktop

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.