By Request VBS Script To Count Bad DDRs And Bad Mifs And Send To Excel


This By Request VBS script will allow you to hard code a Universal Naming Convention (UNC) path to your Bad DDRs and Bad Mifs directory folders and count the number of root files in each and send the results to excel.


VBS Script:


Set oFSO = CreateObject("Scripting.FileSystemObject")


Set BAD_DDRS = oFSO.GetFolder("\\SiteServerName\SMS_XXX\inboxes\\BAD_DDRS")

Set oFiles1 = BAD_DDRS.Files


Set BADMIFS = oFSO.GetFolder("\\SiteServerName\SMS_XXX\inboxes\auth\\BADMIFS")

Set oFiles2 = BAD_DDRS.Files


Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True


intRow = 2


objExcel.Cells(1, 1).Value = "Bad DDR's Count"

objExcel.Cells(1, 2).Value = "Bad Mifs Count"

objExcel.Cells(intRow, 1).Value = oFiles1.Count

objExcel.Cells(intRow, 2).Value = oFiles2.Count

intRow = intRow + 1



objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True



MsgBox "Done"



Published Sunday, March 16, 2008 8:38 AM by dhite
Filed under:


No Comments