I need some assistance in writing a WSH or VBScript on deleting files older than "?" date left in Exchange Spam.Imap subfolders that I can run remotely, or in a scheduled batch job, on a Windows 2000 and 2003 server. The current folder structure is
\\Server5\MDaemon\Users\Company.net\Usernames\Spam.IMAP. There are 3500 different "Usernames".
How can I recursively select the Spam.IMAP subfolder without having to select the Username - since users will be added or deleted in the company without my knowledge?
Here is an example of a script file that removes old Message (*.msg) files prior to July 01, 2005.
---------------------------------------------------------
strDate = "20050701000000.000000+000"
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_DataFile Where CreationDate < '" & strDate & "'" & _
" AND Extension = 'msg'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
---------------------------------------------------------
Please help!
\\Server5\MDaemon\Users\Company.net\Usernames\Spam.IMAP. There are 3500 different "Usernames".
How can I recursively select the Spam.IMAP subfolder without having to select the Username - since users will be added or deleted in the company without my knowledge?
Here is an example of a script file that removes old Message (*.msg) files prior to July 01, 2005.
---------------------------------------------------------
strDate = "20050701000000.000000+000"
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_DataFile Where CreationDate < '" & strDate & "'" & _
" AND Extension = 'msg'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
---------------------------------------------------------
Please help!