well, never mind...I guess... actually I just got it working! Turns out I didn't need to add the seconds to the date after all, all i needed to do was int64 + iSeconds and the WMI in Vista takes care of the rest. I found a very obscure reference on the 'net that indicated something other then what i was led to believe, tried it out, and the converted autoit code works in PB without the date add after all but doesn't work without it in autoit, go figure.
Thanks for your help though, I will keep your work with dates in mind as its very good.
heres my first working version for the odd InstalledOn conversion for Vista (needs srod's COMate), turned out to be eaisier then i thought:
Code: Select all
; needs uses srod's COMate
Procedure.s ConvertFILETIMEtoDateTime(filetime_in.s, UTC_True_False.i)
;converts a date in the string FILETIME format to the CIM datetime format
Define.COMateObject dateTime
dateTime = COMate_CreateObject("WbemScripting.SWbemDateTime")
If dateTime
datetime\Invoke("SetFileTime('" + filetime_in + "')")
If UTC_True_False = 0
cim_date_time_out$ = dateTime\GetStringProperty("GetVarDate(#False)") ; we get the local without UTC offset
EndIf
If UTC_True_False = 1
cim_date_time_out$ = dateTime\GetStringProperty("GetVarDate(#True)") ; we get the local with UTC offset
EndIf
EndIf
dateTime\Release()
ProcedureReturn cim_date_time_out$
EndProcedure
Procedure.s GetVistaInstalledOn(InstalledOn_in.s) ; input InstalledOn from Win32_QuickFixEngineering in Vista only
;test value for InstalledOn_in.s = 01c8ec35ed9110f1
high.q = Val("$" + Mid(InstalledOn_in, 1, 8))
low.q = Val("$" + Mid(InstalledOn_in, 9, 8))
int64.q = high * Pow(2, 32) + low
iSeconds.q = Round(int64 / 10000000, #PB_Round_Nearest)
date_out.q = int64 + iSeconds
out_date$ = Str(date_out); for test value above the file time here is 128612318604418288 which is exactly correct for the date shown below at the return
Installed_On_Vista_OFE$ = ConvertFILETIMEtoDateTime(out_date$, 0)
; get the date without UTC offset factored in
ProcedureReturn Installed_On_Vista_OFE$ ; returns the date in the format> i.e... 7/23/2008 1:24:20 AM
EndProcedure
Debug GetVistaInstalledOn("01c8ec35ed9110f1") ;< Vista test value for this computer
seems to be working correctly on Vista here and producing the correct information. Its not for XP, its a Vista only thing.