PC Review


Reply
Thread Tools Rate Thread

Automatic File Deletion

 
 
Mike
Guest
Posts: n/a
 
      20th Nov 2003
Can I set up a task to autmatically delete files created
at least 10 days ago?
 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      20th Nov 2003
This VBScript may work for you.

Dim fso, f, f1, fc, s
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]

"Mike" wrote:
> Can I set up a task to autmatically delete files created
> at least 10 days ago?



 
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
Automatic Deletion of Email RTB Windows Vista Mail 4 1st Apr 2010 12:50 PM
Automatic Deletion Citrus Windows Vista Mail 1 22nd Dec 2009 05:04 PM
Automatic deletion in InBox RMann Microsoft Outlook Discussion 0 11th Oct 2008 03:50 AM
Automatic Conditional Row Deletion? Go Terps Microsoft Excel Programming 12 23rd Apr 2008 05:48 PM
Re: Deletion of automatic comma Douglas J. Steele Microsoft Access 0 28th Apr 2004 10:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:07 PM.