Skip navigation

HT1629: Mac OS X v10.4 and later: How to prevent .DS_Store file creation over network connections

Learn about Mac OS X v10.4 and later: How to prevent .DS_Store file creation over network connections

HT1629 .ds_store on desktop

8356 Views 13 Replies Latest reply: May 11, 2013 8:17 AM by Ineedsomehelpwiththis RSS
liskabadabiska Calculating status...
Currently Being Moderated
Sep 30, 2012 11:28 AM

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)
  • Niel Level 10 Level 10 (234,585 points)
    Currently Being Moderated
    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)

  • MrHoffman Level 6 Level 6 (11,700 points)
    Currently Being Moderated
    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.

  • jayxtee Level 1 Level 1 (0 points)
    Currently Being Moderated
    Dec 2, 2012 3:40 PM (in response to Niel)

    I just want to hide it on the desktop.  Is there another trick to do just that?  I'm very new to applescript:-(

  • MrHoffman Level 6 Level 6 (11,700 points)
    Currently Being Moderated
    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

  • jayxtee Level 1 Level 1 (0 points)
    Currently Being Moderated
    Dec 3, 2012 3:13 PM (in response to MrHoffman)

    Is there a way to show hidden files in finder but not on the desktop?

     

    tnx

  • MrHoffman Level 6 Level 6 (11,700 points)
    Currently Being Moderated
    Dec 3, 2012 4:53 PM (in response to jayxtee)

    There is no hidden-files knob specific to the desktop folder.

  • Lloydfsd Level 1 Level 1 (0 points)
    Currently Being Moderated
    Mar 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?

  • MrHoffman Level 6 Level 6 (11,700 points)
    Currently Being Moderated
    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.

  • jayxtee Level 1 Level 1 (0 points)
    Currently Being Moderated
    Mar 28, 2013 1:49 PM (in response to MrHoffman)

    I'm coming to realize that if I want to see hidden files, I have to live with the .ds_store on the desktop.

     

    thanks

  • picklern Calculating status...
    Currently Being Moderated
    Apr 3, 2013 7:18 AM (in response to MrHoffman)

    This suggestion works perfectly if after you enter the above, then you also go to Apple, force quit, click on finder and click relaunch. Viola, it's gone! Thanks, MrHoffman!

  • Ineedsomehelpwiththis Calculating status...
    Currently Being Moderated
    May 11, 2013 8:16 AM (in response to jayxtee)

    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

  • Ineedsomehelpwiththis Level 1 Level 1 (0 points)
    Currently Being Moderated
    May 11, 2013 8:17 AM (in response to liskabadabiska)

    or

     

    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

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.