Burzin
At 03:27 PM 12/15/2003, you wrote:
rules.vbs schedule it in windows using csript. Change drive letters and paths to match your settings.
********************************** rem *** invoke it with : cscript rem *** Script checks subfolders below the specified root and copies template rem *** V2 - Will skip files that are hidden or read-only
dim strFileName dim nowDate dim intDateBack dim strLogFolder dim strFilePath Dim fs, f, f1, fc, s
TemplateFile = "D:\IMail\master\bounce.fwd" TemplateFile2 = "D:\IMail\master\alertbox.fwd"
strFilePath = "D:\Imail" strLogDump = "D:\Imail\Copiedrules-users.txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fs = wscript.CreateObject("Scripting.FileSystemObject") Set fs2 = wscript.CreateObject("Scripting.FileSystemObject")
CheckFiles strFilePath
Set fs2 = nothing Set fc= nothing Set f = nothing Set a = nothing Set fs = nothing Set FSO=nothing
' ****************************************************************************
' This function copies the template to each of the folders received as parameters
Sub CopyFileTo (strFilePathLong)
On Error Resume Next
' copy template1 to this folder, checking attributes first...
filename1=strFilePathLong & "\" FSO.CopyFile TemplateFile, filename1 , TRUE s = s & filename1 s = s & vbCrLf
' copy template2 to this folder, checking attributes first...
filename1=strFilePathLong & "\" FSO.CopyFile TemplateFile2, filename1 , TRUE ' s = s & filename1 ' s = s & vbCrLf
' write a log with the files removed...
if fs.FileExists(strLogDump) then fs.DeleteFile(strLogDump) end if Set a = fs.CreateTextFile(strLogDump, 8,0) a.WriteLine(s) a.Close
End Sub
' ****************************************************************************
' This function check for files inside the folder, and erases old files there
Sub CheckFiles (strFilePathLong)
' First check files in this folder...
Set g = fs2.GetFolder(strFilePathLong) Set gc = g.Files
' Now check folders inside this one
Set gc2 = g.SubFolders For each g1 in gc2 strFilePathLong = g1.path
CopyFileTo strFilePathLong
CheckFiles strFilePathLong Next
End Sub
****************************************
-----Original Message----- From: Burzin Sumariwalla [mailto:[EMAIL PROTECTED] Sent: Monday, December 15, 2003 1:27 PM To: [EMAIL PROTECTED] Subject: [IMail Forum] Rules and batch help
Hi,
I'd like to copy a rules.ima file on a recurring basis to all my users accounts. I'd like to avoid a couple of problems and was wondering how I can compare two directory outputs of /users and obtain a third list that contains the differences between the two. FC seems like its a good choice, but it doesn't create a usable list that I can then process.
Any ideas?
Thanks, Burzin
------ Burzin Sumariwalla Phone: (314) 994-9411 x291 [EMAIL PROTECTED] Fax: (314) 997-7615 Pager: (314) 407-3345
Networking and Telecommunications Manager Information Technology Services St. Louis County Library District 1640 S. Lindbergh Blvd. St. Louis, MO 63131
--- [This E-mail scanned for viruses by Declude Virus]
To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/ --- [This E-mail scanned for viruses by Declude Virus]
------ Burzin Sumariwalla Phone: (314) 994-9411 x291 [EMAIL PROTECTED] Fax: (314) 997-7615 Pager: (314) 407-3345
Networking and Telecommunications Manager
Information Technology Services
St. Louis County Library District
1640 S. Lindbergh Blvd.
St. Louis, MO 63131
--- [This E-mail scanned for viruses by Declude Virus]
To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/ Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
