Ok so first of all please forgive my ignorance in this question but I am very new to VBScripting and when I say very new I mean since lunch today!
I have a small handful of VBScripts I have adapted from Openview into Solarwinds and they are working normally returning the information that I am looking for. That being said however I am not using arguments but rather specifying the strings directly in the scripts. For ease of use in the templates how do I take a script and utilize arguments instead.
Here is an example of a script I have searching for any .log files older than 60 days in a particular directory. I would basically have three variables.
Directory, File Extension, and the number of days older than. I would like to utilize arguments instead so our admins can just enter them into the arguments section and not have to modify the scripts.
Dim fso, count, src, folder, file
Set fso = CreateObject("Scripting.FileSystemObject")
src = "F:\errors\"
Set folder = fso.GetFolder(src)
count = 0
For Each file In folder.files
If LCase(fso.GetExtensionName(file)) = "log"and file.DateLastModified < dateadd("d", -60, Now) Then
count = count + 1
End If
Next
WScript.Echo "Statistic: " & count