Mac Hidden Files Annoyance in Windows

Here’s a very big annoyance that I have stumbled across whenever I mount a removeable drive into my Mac and then later mount that same removeable drive into my PC running Windows. Mac OS X’s Finder application always adds the .DS_Store and .Trashes hidden files/folders into each folder I happen to browse through. In UNIX and Mac OS X, it always treats files or folders prefixed with a dot as hidden. Windows has no such notion of treating dot files/folders as hidden. Therefore, the files stay unhidden when browsed by a Windows PC. I did some research on this subject and there doesn’t appear to be any solutions that exist that automatically take care of this. The best solution is for Mac OS X to add the hidden attribute on any dot files/folders created, but somehow this solution has eluded the developers of Mac OS X. To solve this issue, I’ve created a DOS batch script that you can run in Windows whenever you mount your removeable drive. Simply, create a file called cleanosx.bat and type in the following.

@echo off
echo Removing all Mac OS X hidden file stubs matching ._ ...
del /S ._*
echo Hide all remaining Mac OS X hidden files/folders for Windows...
attrib +h .* /S /D
echo Done.

Run this script at the root level of your removeable drive and it should take care of removing junk files left over from browsing while in Mac OS X as well as setting the hide attribute on all the dot files/folders. If you don’t want to see the hidden files/folders in Windows Explorer, just make sure the Show hidden files and folders is NOT checked in the Tools > Folder Options > View > Advanced settings dialog window

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.