Your Ad Here
Sep
20
2009
0

Dealing with pesky .DS_Store and dot underscore files between Mac and Windows

If you use Windows Servers and Mac OS X in the same environment and share files, more than likely you have encountered seeing a bunch of .DS_Store files and files that start with ._ on your Windows file servers and SMB shares.

There are several ways you can take care of this on both the Mac OS X client and the Windows Server side.

On your Mac OS X, you can prevent creation of .DS_Store files by opening Terminal and typing the following command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

You will need to hit return and restart your Mac for changes to take effect.

More information is detailed in the following KB article from Apple Support.

On your Windows Server, there are a variety of tools, scripts and utilities you can use to both run through your drive and delete these files or even monitor in real-time for their creation and deletion. One easy way to do this is to write a simple batch file to delete these files.

The batch file would look something like this, assuming you wanted to clean up Drive H:

@ECHO OFF
:: DotClean version 0.1
:: 9/20/2009
:: breednet.net – any rights reserved, but free to use and enjoy
::
:: Deleting DS_Store and dot underscores from removable drives H: and I:

ECHO Cleaning up Mac DS_Store files on Drive H: …
del /q /s “H:\*.DS_Store”

ECHO Cleaning up Mac “dot underscore” files on Drive H: …
del /q /s “H:\._*”

You can also run a VBScript on your Windows server to detect and delete the file creation in real-time. There is a great article here that covers this, as well as the source code for DotUnderscore.vbs.

  • Share/Bookmark
Your Ad Here