
Hi guys I have been working with this script - it works well - it copies the files for a specific date and extentsion - but I just cant figure out how to get it to copy the files that are in the subfolders in addition to whats in the root, I tried a few variations with no success - here is the current script:
VBSTART
Dim BackupFilesSigDate, filesys, oFolder, srcfolder, tgtfolder, oFile
BackupFilesSigDate = Date -1
srcfolder = "C:\"
tgtfolder = "24HrBackUp\"
Set filesys = CreateObject("Scripting.FileSystemObject")
Set oFolder = filesys.GetFolder(srcfolder)
If Err.Number 0 Then
Wscript.echo "The Source Folder does not exists. Operation aborted."
Set oFolder = Nothing
Set filesys = Nothing
Else
For Each oFile In oFolder.Files
If DateDiff("d", BackupFilesSigDate, oFile.DateCreated) = 0 Then
filesys.copyfile oFile.Path, tgtfolder & "\" & oFile.Name, True
End If
Next
End If
Set oFile = Nothing
Set oFolder = Nothing
Set filesys = Nothing
VBEND
VBRun>