1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VB Script Problems for Discovering folder size

Discussion in 'Windows Server' started by Bulldog329, Feb 7, 2013.

Thread Status:
Not open for further replies.
  1. Bulldog329

    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
     
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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1088553

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice