File screening : how to run a delete command ?


  • Hello,

    I'm trying to get rid of "._" files on my Windows 2003 R2 file server.
    Each time a user creates this kind of files, I'd like to be able to delete them.
    For this I think File server resource management's file screening can help.
    I created a new passive filter targeted to the desired directory with a new group file ._*
    Now I'd like to run a delete command on the targeted directory.
    On the command tab I selected "run command" I also selected the correct directory and added "del /s" as command but it doesn't work.

    What am I missing ?
    Any help would be appreciated.

    Thursday, July 02, 2009 10:28 AM

All replies

  • If I understand you correctly, running 
                 ECHO Y | del *._* /s
    from a batch file at login (for example) should work fine.

    EDIT :
    Just seen this :
    Thursday, July 02, 2009 2:57 PM
  • Thanks,
    I'd like to be able to delete the ._ files immediately though.
    That's why I think File screening can help, otherwise just a common script could have make the job.
    Now I think I have configured file screening correctly but I'd like to run my delete command only on the directory specified in File screening and I don't know how. If I can't do this I will have to change my delete script for every directory I want to apply my command on.
    Hope what I'd like to do is possible.

    And yes you're right that's a Mac related problem ! But all the client-side solution are quite tricky and not very applicable to my situation I think. What's quite easy is to disable the creation of .DS_Store files but for the other ._ files it's another problem. 
    Friday, July 03, 2009 7:11 AM
  • Hello P-A,


    If you can try editing the file screening properties, you may find there is a button call "Working directory" when you select the command tab in the file screen properties. You can try to specify the delete file bat to run and work on the directory to which the quota or file screen applies by modifying it.



    Hope this can be helpful.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by David Shen Saturday, July 04, 2009 3:15 PM
    • Marked as answer by David Shen Monday, July 06, 2009 2:38 AM
    • Unmarked as answer by P-A Monday, July 06, 2009 7:59 AM
    • Unproposed as answer by David Shen Monday, July 06, 2009 8:18 AM
    Friday, July 03, 2009 8:41 AM
  • Thanks very much.
    I don't know if we say this in English but "Sometimes a small picture is worth more than a long talk".
    Just seeing the screen in a screen capture made me understand better.

    I will try to enter del /S /A:H ._* and apply it on the "Directory to which the quota or file screen applies" as you mentioned.

    I've been confronted to other problems though.
    First I couldn't delete hidden files so I appended /A:H to resolve this.
    Secondly my script refused to execute through file screeening : Security problem : script's directory not secured. I also resolved it.

    Now I really have a strange behaviour, the script seems to execute only once and then it doesn't work anymore. It is the same for the event I also ticked. It is only reported once in the event viewer. Then if I retry later sometimes it works.

    I'm trying to find what cause this behaviour.
    Friday, July 03, 2009 2:38 PM
  • Sorry to mark as unanswered but I can't make the command work correctly.

    What works is just activating Active filtering. After that I can't create ._ files, but that's not what I need !

    I created two scripts one delete test script and one make directory test script.
    If I load the script manually it works. If I load it through File Screening passive filter and run command, it doesn't work.

    My first script (it was a delete ._* files) worked from time to time : sometimes when I copy ._ files it executes itself (and delete ._ files) sometimes not. When it executes you then have to wait for quite a long time before it works another time.
    My new test script (make directory) has not worked yet.

    Someone already tested File Screening (passive filter) with run command in a working environment ?

    Monday, July 06, 2009 8:17 AM
  • I'm having the same issue while attempting to delete desktop.ini files.

    Just as the image above, I'm using a passive file screen to run a batch file with the working directory set to the directory which the file screen applies.  It doesn't appear that the command is running.

    The batch file is about as simple as they get:

    @echo off
    del .\desktop.ini

    I also have an email alert enabled in the file screen.  When I create a desktop.ini file in a subfolder of the path which the file screen is applied to the email is received, but the file is not deleted.

    If I manually execute my batch file from within the directory containing the desktop.ini the batch file works as expected and deletes my file.  It looks as if the command simply isn't being executed by the file screen.

    Has anyone been able to successfully run any command via a passive file screen?

    **** I should add:  This is on Windows 2003 R2 x64 SP2.  Also, I've tried setting the permissions on the command tab to Local Service and Local System

    • Edited by Robert Biddle Wednesday, March 02, 2011 4:22 PM additional info
    Wednesday, March 02, 2011 4:19 PM
  • As far as the Desktop.ini, if you are trying to do this to stop the folders as appearing as My Documents, you are better off using file screen to stop creation rather than delete.  Then just run a batch to delete the current ones, and you are done.  We have had to do this before.
    Sunday, May 15, 2011 11:58 AM