I'm trying to troubleshoot a vbs script that runs fine on some Win2000
servers but not others. If I manually run the script it runs fine, but if I
let a tool called Big Brother run it, it doesn't return any data. The Big
Brother tool should be running it using the system account. It previously
returned data until I put a MonthName() requirement in.

All servers are Win2000 SP4 and patched up to Aug patches. I've looked at
wmimgmt.msc and tried to compare settings. I think I see some security
differences there but don't know if I'm even touching this. In comparing a
system that works to one that doesn't they are both using wsh 5.6. They may
be at different mdac levels if that matters.

The script reads a registry setting, separates out the date and compares it
to todays date. It then sends updates based on the results to the Big
Brother tool.
I'm looking for some help in troubleshooting why it will run under my
account and not the system and why it runs fine on 5 out of 8 systems.

RE: Script works on one Win2000 server but not another by Maureen

Maureen
Wed Sep 13 18:05:02 CDT 2006

Here's the script. I've taken someone elses script and added modifications:
Dim oShell,oDef,oVer,oRev,oDate,oOutFile,oFSO,oNDate,oToday,oToday2

'****Change the following path to point to your BBNT EXTERNALPATH location***
Const cExtPath = "o:\sysadmin\bbalerts"

'----Create Output file
Set oFSO= CreateObject("Scripting.FileSystemObject")
Set oOutFile = oFSO.CreateTextFile (cExtPath &"\SA_AV")

'------Check Virus Def Date by reading value from registry
Set oShell = WScript.CreateObject("Wscript.Shell")
oDef = oShell.RegRead ("HKLM\SOFTWARE\Symantec\SharedDefs\DEFWATCH_10")
oVer = Right(oDef,12)
oRev = Right(oVer,3)
oDate = Left(oVer,8)
oYear = Left(oDate,4)
oMonth = MonthName(Mid(oDate,5,2))
oDay = Right(oDate,2)
oNDate = oMonth &" "& oDay &", "& oYear

oToday = FormatDateTime(Now, vbLongDate)

'date info sent to BB as update date/time
oToday2 = FormatDateTime(Now, vbLongDate)&" "&FormatDateTime(Now, vbLongTime)

'----Determine age of virus definitions, if more thn 7 days old display
yellow on BB
oDateDiff = DateDiff("d", oNDate, oToday)

If (oDateDiff > 14) then
oOutFile.WriteLine "red+25h " & oToday2
ElseIf (oDateDiff > 7) then
oOutFile.WriteLine "yellow+25h " & oToday2
Else oOutFile.WriteLine "green+25h "& oToday2
End If

'-------write results to file
oOutFile.WriteLine vbCrLf &"Found Symantec Anti Virus definition file
version:"
oOutFile.WriteLine oNDate &" Rev. "& oRev
oOutFile.WriteLine "Virus definitions are "& oDateDiff &" day(s) old"


RE: Script works on one Win2000 server but not another by Maureen

Maureen
Wed Sep 13 22:34:01 CDT 2006

Found it. This line on 3 problem servers was returning the day of the week
along with the date. ie. Wednesday, September 13, 2006.
Been trying to format and compare dates many ways as depending on server -
month/day kept getting flipped around so decided to go with full month name
to avoid flips and then ran into this vbLongDate problem.

> oToday = FormatDateTime(Now, vbLongDate)