Automatically remove "._" files from Windows shares

Jun 27, '06 07:30:00AM

Contributed by: Rilex

Mac OS X, when connecting via SMB, will leave ._ files on Windows shares. This can sometimes cause problems for others accessing these files, automated programs, etc. I have created a script called DotUnderscore.vbs to handle this problem. This script will monitor and delete files based on a string within the file name (e.g. ._). To use this script, I recommend creating a Scheduled Task on Windows to start it up at system startup, so it will continually run.

Here are some examples on the command line that you would pass to the script:

cscript.exe DotUnderscore.vbs C:Temp ._
That would delete all files that had ._ within their filename from the directory C:Temp. Note that directories containing spaces must have quotation marks around them, e.g.:
cscript.exe DotUnderscore.vbs "C:Documents and Settingsusername" ._
As always, test on a test directory before you put it into production. This script may or may not work with certain non-standard symbol or alphanumeric characters in the folder name.

[robg adds: Just to state the obvious, this is a script that resides and runs on the Windows server, not the Mac. These four previous hints deal with the same topic.]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060623171530952