Login | |
|
 |
RE: Copying Files Based On Modified Date - 7/1/2008 1:33:15 AM
|
|
 |
|
| |
Slenk9980
Posts: 27
Score: 0
Joined: 7/1/2008
Status: offline
|
I did do a search and found 1 thread with 1 response but not answered. I apologize if I've asked a previously answered question.
|
|
| |
|
|
|
 |
RE: Copying Files Based On Modified Date - 7/2/2008 2:46:14 AM
|
|
 |
|
| |
Slenk9980
Posts: 27
Score: 0
Joined: 7/1/2008
Status: offline
|
Can some one point my in the right direction? I can't seem to find how to copy files based on modified date. Sorry.
|
|
| |
|
|
|
 |
RE: Copying Files Based On Modified Date - 7/2/2008 3:38:00 AM
|
|
 |
|
| |
Slenk9980
Posts: 27
Score: 0
Joined: 7/1/2008
Status: offline
|
Ok here's what I found. This oviously copies all files that are older than 1 month. How can I look at certain file types? Like I want to copy only *.txt files older than 1 month. I aplogize for not putting the code in brackets. Copied from an email and it was putting in all kind of funky stuff. Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("C:\Temp\") Set colFiles = objFolder.Files dtmMonthAgo = DateAdd("m", -1, Now) For Each objFile in colFiles If objFile.DateLastModified < dtmMonthAgo Then objFSO.CopyFile objFile.Path, "C:\Temp\Old\" End If Next
|
|
| |
|
|
|
|
|