Hi Nick -
 
I like this.  Do I need to set this up as a task, or how will it run? 
 
Thanks for any tips.
 
Todd


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nick Hayer
Sent: Monday, April 03, 2006 3:59 PM

Take that code, adjust the paths/email addresses as need be, save it as a .vbs file and give it a twirl. Set the count real low so you can see it work and then set it to whatever alarm level you would like -

-Nick



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Nick Hayer
Sent: Monday, April 03, 2006 11:03 AM
To: Declude.JunkMail@declude.com
Subject: Re: [Declude.JunkMail] Hijack Notification

Hi John,

>John Doyle wrote:

>this guy suggested this.
>I'm not sure exactly how. looks like if a count is > some value send the
>mail.


I was just suggesting that the number of files in the spool dir exceed some number [100?]  then send an email.  I got the idea from the hijack vbs code [Thanks!] on the declude website which I kludged to work to notify for the spool overflows..

-Nick

# spool_mon.vbs
fSpool = "e:\imaillogs\spool"
aMail = "e:\imail\imail1.exe "
mFrom = "-u '[EMAIL PROTECTED]' "
mTo1 = "-t '[EMAIL PROTECTED],[EMAIL PROTECTED]' "

if GetFileCount(fSpool) > 100 then
    MailNotice "Spool", GetFileCount(fSpool), mTo1
end if

Function GetFileCount(folderspec)
    Dim fso, f, f1, fc
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(folderspec)
    Set fc = f.Files
    GetFileCount = fc.count
End Function

Function MailNotice(fname, fcount, mTo)
    Dim mCmd, mSubj, WshShell
    set WshShell = WScript.CreateObject("WScript.Shell")
    mSubj = "-s 'Mail held in " & fname & ": " & fcount & "' "
    mCmd = aMail & mFrom & mTo & mSubj & "-f placeholder.txt"
    Return = WshShell.Run(mCmd , 1, TRUE)
End Function


Reply via email to