Login | |
|
 |
copy directory structure w/date exception - 9/5/2008 10:59:59 AM
|
|
 |
|
| |
knoviello
Posts: 2
Score: 0
Joined: 9/5/2008
Status: offline
|
I am trying to copy and retain the directory structure of a given folder with all its folders and files to another location. Also I need it to copy files only older than 1 month. As you can see I have started the script below but it is so inadequate right now. Any help is appreciated. I searched the forums for a while but couldn't find relevant info sorry if this is a common question. Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("\\Source") Set colFiles = objFolder.Files dtmMonthAgo = DateAdd("m", -1, Now) For Each objFile in colFiles If objFile.DateLastModified < dtmMonthAgo Then objFSO.MoveFile objFile.Path, "\\Destination" End If Next
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|