First of all i must thank you for your quick reply.
before go to that Microsoft link i wanna clear my question again,it might am not clearly explained
On your code
If dateDiff("d", file.DateCreated, Date) < 2 Then 'copy file if it's "2 days old"
this will find it out is this any file is two days old on that folder.
I wanna run my script every one hour interval and find it out is this any new file in between that interval.
is that make you clear ?
Am not sure is this any function like timediff ?
If TimeDiff("d", file.DateCreated, Time) < 1 Then 'copy file if it's "1hr old"
I just gone thru that like hope that helps me...but need to do some modification based on my copy.
Main Topics
Browse All Topics





by: sirbountyPosted on 2007-02-14 at 07:53:15ID: 18532254
http://www.microsoft.com/t echnet/scr iptcenter/ resources/ qanda/oct0 4/hey1011. mspx contains a script to monitor a folder for the creation of a file...would that be what you're looking to do?
ting.FileS ystemObjec t") r("C:\Fold erA\")
Otherwise, you can use something like this to run hourly...
Dim objFSO:Set objFSO=CreateObject("Scrip
Dim objFolderA: Set objFolderA=objFSO.GetFolde
strFolderB="C:\FolderB\"
For Each file in objFolderA.Files
If dateDiff("d", file.DateCreated, Date) < 2 Then 'copy file if it's "2 days old"
objFSO.CopyFile file.Path, strFolderB
End If
Next
Set objFSO=Nothing