1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

v11 idea del by date

Discussion in 'Suggestions' started by jimklein, Feb 5, 2009.

  1. jimklein

    Joined:
    Dec 24, 2008
    Messages:
    21
    Likes Received:
    0
    I would love to see something that makes deleting files aged by x days so shared areas could be easily maintained.

    Jim
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,312
    Likes Received:
    39
    TCC already has this; type HELP DATERANGES for details. (Ranges can be used in any of the internal file-handling commands, not just DIR.)

    Code:
    @echo off
    *setlocal
    *unalias *
     
    set n=14
     
    alias purge=`if .%1 ne . if isdir %1 pushd %1 && ( del /[dc-%n,1980-01-01] /s /e /x /y /z * %+ popd )`
     
    purge "%systemroot\temp"
    purge "%temp"
     
    endlocal
    
     
  3. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    It may be that looking at date ranges will help you do exactly what you
    want.
    help dateranges

    On Thu, Feb 5, 2009 at 10:40 AM, JP Software Forums <neil@jpsoft.com> wrote:


    --
    Jim Cook
    2009 Saturdays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Sunday.
     

Share This Page