I'm trying to automate the process of moving archived email folders off our mail server to a backup server based on age criteria.
I thought I had the whole thing working, but now the age requirement isn't working.
here's my code
dim oFS, oFolder, nfolder, count, count2, maxage, includesubfolders, oSubFolder, of, nf
of = "C:\Documents and Settings\user\Desktop\test"
nf = "C:\Documents and Settings\user\Desktop\test2"
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
set oFolder = oFS.GetFolder(of)
set nFolder = oFS.GetFolder(nf)
set osubfolder = ofolder.subfolders
count = nfolder.subfolders.count
maxage = 1
includesubfolders = true
for each osubfolder in ofolder.subfolders
on error resume next
IF oSubFolder.DateLastModified < (Now - MaxAge) THEN
oFS.copyFolder of, nf
count2 = nfolder.subfolders.count
if count2 > count then