PC Review


Reply
Thread Tools Rate Thread

Delete files based on date

 
 
Jeff Jones
Guest
Posts: n/a
 
      22nd Sep 2003
Are there any out of the box utilities that will delete
files based on their timestamp for WIN2k? I could do it
with robocopy or xcopy, but do not want to copy any
files. I just want to complete some log cleanup. Thanks
 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      22nd Sep 2003
This VBScript may work for you.

Dim fso, f, f1, fc
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("J:\aaaa")
Set fc = f.Files
For Each f1 in fc
If DateDiff("d", f1.DateLastModified, Now) > 30 Then
f1.Delete
End If
Next
Set fso = Nothing
Set f = Nothing
Set fc = Nothing

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]

"Jeff Jones" <(E-Mail Removed)> wrote in message
news:000d01c38123$ef39d8d0$(E-Mail Removed)...
> Are there any out of the box utilities that will delete
> files based on their timestamp for WIN2k? I could do it
> with robocopy or xcopy, but do not want to copy any
> files. I just want to complete some log cleanup. Thanks



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete rows based on date input bingshuo.li@gmail.com Microsoft Excel Programming 3 17th Nov 2008 11:01 PM
Re: delete based on date in input box Bob Phillips Microsoft Excel Programming 0 5th Jan 2007 02:02 PM
delete files based on date created =?Utf-8?B?Ui5Eb3V0aHdhaXRl?= Microsoft Access VBA Modules 0 7th Feb 2006 02:17 AM
Delete files in folder based on modified date, but not others. richardkreidl@northwesternmutual.com Microsoft VB .NET 3 2nd May 2005 04:10 AM
Delete files in folder based on modified date. richardkreidl@northwesternmutual.com Microsoft VB .NET 0 27th Mar 2005 09:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:33 PM.