stanl
03-17-2009, 05:50 AM
I'm playing around with a function to convert a REG BINARY value that represents a date into an actual date and account for the GMT bias. I chose the windows ShutDown as a start. The first step would be to read the registry key - which should return an 8-paired hex string
However, this simple sub I wrote for Excel
Sub getshutdown()
Dim key As String
Dim myWS As Object
key = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Windows\ShutdownTime"
Set myWS = CreateObject("WScript.Shell")
Rkey = myWS.RegRead(key)
Cells(1, 1).Value = Rkey
End Sub
returns a numeric value - 68.
Either I have misrepresented the key or something else is wrong.
Stan
P.S. what is interesting about the value returned is it has to be manipulated from 1/1/1601 [base date]
However, this simple sub I wrote for Excel
Sub getshutdown()
Dim key As String
Dim myWS As Object
key = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Windows\ShutdownTime"
Set myWS = CreateObject("WScript.Shell")
Rkey = myWS.RegRead(key)
Cells(1, 1).Value = Rkey
End Sub
returns a numeric value - 68.
Either I have misrepresented the key or something else is wrong.
Stan
P.S. what is interesting about the value returned is it has to be manipulated from 1/1/1601 [base date]