Below is some simple code that I am using to grab some inventory information. This works perfectly on Windows XP, Windows 2003 and Windows 7. However on Windows Vista and WIndows 2008 the InstalledOn data is in a format I am totally unfamiliar with. It appears to be some form of a hex value.
The output that I get for InstalledOn is:
When I compare that to the data I see in the GUI via Add/Remove Programs the real date for that hotfix is:
I've been researching and the best I can come up with is that this somehow equates to the number of ticks since the beginning of year 1601 UTC.
My desired end result is to have a function I can call and have it take the long string and return a recognizeable date.
Any assistance would be greatly appreciated.
Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_QuickFixEngineering",,48)
For Each objItem in colItems
Wscript.Echo "HotFixID: " & objItem.HotFixID
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "InstalledOn: " & objItem.InstalledOn
Next
The output that I get for InstalledOn is:
Code:
01c9c5ce4b48e5fd
Code:
4/25/2009
I've been researching and the best I can come up with is that this somehow equates to the number of ticks since the beginning of year 1601 UTC.
My desired end result is to have a function I can call and have it take the long string and return a recognizeable date.
Any assistance would be greatly appreciated.