Converts a WMI FILETIME value to a VT_DATE value. The TIME_CREATED property trapped by the NextEvent method of the SWbemEventSource object (part of the WMI Scripting API) returns a FILETIME value.

Visual Basic
Edit|Remove
Set dateTime = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colMonitorProcess = objWMIService.ExecNotificationQuery _
 ("SELECT * FROM __InstanceOperationEvent " _ 
 & " WITHIN 1 WHERE TargetInstance ISA 'Win32_Process'")

Set objLatestEvent = colMonitorProcess.NextEvent
Wscript.Echo "Event Class: " & objLatestEvent.Path_.Class
WScript.Echo "Event Time:"
WScript.Echo "  FILETIME format: " & objLatestEvent.TIME_CREATED
dateTime.SetFileTime objLatestEvent.TIME_CREATED, False
WScript.Echo "  VT_DATE format: " &  dateTime.GetVarDate