Archived from groups: microsoft.public.win2000.security (
More info?)
Eric,
I had to do the same exact thing about 2 months ago. Below is a script
that will take care of it. The only thing you should need to change is
the "dir" variable which is the "root" directory which houses your FTP
files. The scan is recursive so it will also get any files in any of
the subfolders under the root directory.
If you need any help with it let me know and I'll do what I can.
Regards,
SWBradbury
-----------------------------
'This script scans through the FTP folders and deletes all files older
than 14 days.
'Process began on June 1st, 2004
'Written by SWBradbury
Option Explicit
' Create the FileSystem Object
dim oFileSys
dim dir
'Directory to be scanned
dir = "D:\FTPfiles"
Set oFileSys = CreateObject("Scripting.FileSystemObject")
'Start up Sub
GetDir dir
sub GetDir(dir)
dim oFolder,oFolders,oFiles,item,Item2
set oFolder=oFileSys.GetFolder(dir)
set oFolders=oFolder.SubFolders
set oFiles=oFolder.Files
' get all sub-folders in this folder
For each item in oFolders
GetDir(item)
Next
item2=0
'Scan through the files collection, find files older than 14 days,
and delete.
For each item2 in oFiles
Dim accessDate,createdate,fDateInfo,DaysOld
Set fDateInfo = oFileSys.GetFile(item2)
createdate = fDateInfo.DateCreated
accessDate = fDateInfo.DateLastAccessed
DaysOld = DateDiff("d", accessDate, Now)
If DaysOld > 14 Then
item2.delete
end if
next
end sub
-----------------------------
"Ernie" <guess@where.com> wrote in message news:<4140cc75$0$88498$e4fe514c@dreader15.news.xs4all.nl>...
> Try this great (free) tool
> it si GUI based and Command line based (therfor can be put in a simple command file and f.i. scheduled every day)
>
>
http://www.savilltech.com/download.html
>
> DelOld, version 2003 Been around for years. this latest version reads "beta" but is robust rock solid.
> "A great utility to remove files matching a certain age and specification"
>
> gr,
> Erwin
>
>
>
>
> "Eric" <administrator@halexco.com> wrote in message news:69627a12.0409091052.3bc8faf0@posting.google.com...
> >I have been asked by our engineering dept to automatically delete all
> > files folders and subfolders older than 14 days old located in our FTP
> > folder on a windows 2000 server. I have seen several threads about
> > this but don't have the skills to create a program to do this.
> >
> > Is there any software out here that will do this task? If not is
> > there a way someone could walk me through creating a script to do
> > this?
> >
> > Thanks,
> > Eric