VB Script Problems for Discovering folder size

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Bulldog329

Thread Starter
Joined
Feb 7, 2013
Messages
1
I am trying to write a simple VB script to determine the size of an Exchange Catalog indexing folder. This folder changes name each time that is is re-indexed. Below is what I have but I get an error code when running. Any help would be appreciated. Thanks.

strFolderToMonitor = "\\servername\e$\MBDB01-DB\CatalogData?"
intSizeInGB = 1
intSizeInBytes = (intSizeInGB * 1024 * 1024 * 1024)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strFolderToMonitor)

If objFolder.Size > intSizeInBytes Then
strSMTPFrom = "[email protected]"
strSMTPTo = "username@talgov.com"
strSMTPRelay = "relay server name"
strTextBody = "Body of your email"
strSubject = "Subject line"
strAttachment = "c:\test"
Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMessage.Configuration.Fields.Update
oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
oMessage.Send
End If
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top