Trying to use VBS from our monitoring server to generate an alarm for a W2k server that has uptime 25 hours or more. Its the best way I can think of to get an alarm if its daily reboot function hangs for whatever reason. After much testing I finally got the script below working but I realized it is reporting the incorrect amount of hours. I used uptime.exe it shows it as 1 day 11 hours (35 hrs total) and this script is reporting 2433 minutes (40.55 hours). I really don't understand (yet) the whole process of converting UTC to a real number and I'm not sure I want to is there anyone familiar with this script that could provide a fix or at least reason the reporting is off?
strComputer = "servername.domain.com"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOS in colOperatingSystems
dtmBootup = objOS.LastBootUpTime
dtmLastBootupTime = WMIDateStringToDate(dtmBootup)
dtmSystemUptime = DateDiff("n", dtmLastBootUpTime, Now)
Wscript.Echo "Message: System Uptime Alarm"
Wscript.Echo "Uptime"&vbTab& dtmSystemUptime
WMIDateStringToDate = CDate(Mid(dtmBootup, 5, 2) & "/" & _
Mid(dtmBootup, 7, 2) & "/" & Left(dtmBootup, 4) _
& " " & Mid (dtmBootup, 9, 2) & ":" & _
Mid(dtmBootup, 11, 2) & ":" & Mid(dtmBootup,13, 2))