
How do I “report” a value in plain text with vbs??
In short, I have a monitoring program that checks log files for certain errors.
The log files changes name every day but there is an option in the monitoring
program that allows you to create a script that looks up the path and filename
and then opens the file.
I have (with great help from Robert Cohen) created a script that looks up
todays date and then attach that date to a file. This works but when I try to
add the script into my monitoring program it doesnt like it. I need to script
to basically return the value in plain text format (not in a pop-up text box).
Basically I want it to report the path (and ONLY the path) if I run the script
from a dos prompt. Can this be done? And if so how? Below is the script I have
come up with so far.
If anyone has any ideas on what I can do here let me know.
--------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")
oMonth= DatePart("m", Now()) ' looks up todays month
oday= DatePart("d", Now()) ' looks up todays day
if oMonth <10 and oday <10 Then ' adds "0" if month and date is single digits
oFilename= "c:\Data\Logs\file0" & omonth &"0" & oday & ".log"
Elseif oMonth <10 Then ' adds "0" if month is single digit oFilename=
"c:\Data\Logs\file0" & omonth & oday & ".log"
Elseif oday <10 Then ' adds "0" if date is single digit oFilename=
"c:\Data\Logs\file" & omonth &"0" & oday & ".log"
Else ' creates correct path
oFilename= "c:\Data\Logs\file" & omonth & oday & ".log"
End IF
If objFSO.FileExists(oFilename) Then
' This is where the DOS Plain Text reporting would Go
End If
--------------------------