MOM2005 Script to monitor nof files
A small script to create performance-data from the count of files in one folder.
'------------------------------------------------------------------------------------- ' Script to montior nof files in one folder ' ' Rikard Ronnkvist / snowland.se / 2007-11-30 '------------------------------------------------------------------------------------- Dim oFSO, oFolder, oFile, oPerfData Dim folderName, perfData Set oParams = ScriptContext.Parameters folderName = oParams.get("folderName") ' "C:\Path" Set oParams = Nothing Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(folderName) Set oFile = oFolder.Files perfData = oFile.Count Set oFile = Nothing Set oFolder = Nothing Set oFSO = Nothing Set oPerfData = ScriptContext.CreatePerfData With oPerfData .ObjectName = cPerfObject .InstanceName = folderName .CounterName = cPerfCounter .Value = perfData End With ScriptContext.Submit oPerfData Set oPerfData = Nothing