\
Useful Programs
Microsoft Tools
ScriptoMatic
Not without its share of "features" but a very handy tool for testing WMI
queries and getting the basic framework right.
Apart from improvements mentioned below there is a major feature where
it fails to list values and
that is on values which may or may not contain an array. All such values
should be generated via a function which takes care of the details (you would need to manually add this)...
Get more details and download it from "http://www.microsoft.com/technet/scriptcenter/tools/wmimatic.mspx
".
Some similar tools:
Replace the "WMIDateStringToDate()" function with the following routine
which handles malformed dates rather than causing a trap:
Function WMIDateStringToDate(dtmDate)
on error resume next
WMIDateStringToDate = dtmDate
if dtmDate <> "" then
dim FmtDate
err.clear()
FmtDate = CDate(Mid(dtmDate, 5, 2) & "/" _
& Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) _
& ":" & Mid(dtmDate,13, 2))
if err.number <> 0 then
FmtDate = "<<Unexpected WMI date format>>"
else
FmtDate = "(" & FmtDate & " local time)"
end if
WMIDateStringToDate = WMIDateStringToDate & " " & FmtDate
end if
End Function