|
-
Jun 9th, 2002, 09:18 PM
#2
New Member
Hi guys,
Thanks for all your help.
I managed to do it and below is my script just
to share with all of you. Again, thanks a lot, appreciates much.
Dim objFSO, objTStream, s, fd, fd2, fd3
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set fd = objFSO.GetFolder("C:\dhl\DCS3.0\logs\")
If fd.files.count > 0 Then
For Each filesx in fd.files
Set fd2 = objFSO.GetFile("C:\dhl\DCS3.0\logs\" & filesx.name)
'Date - 1 day
NewDate = DateAdd("d", -1, Date)
s = fd2.DateCreated
'Date for the File Created
GetDay = DatePart("d", s)
GetMonth = DatePart("m", s)
GetYear = DatePart("yyyy", s)
CreatedDate = DateSerial(GetYear, GetMonth, GetDay)
If CreatedDate = NewDate Then
fd2.Delete
End If
Next
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|