Sub
Test()
Dim
sngTZNr, sngLRegKey
As
Single
Dim
strText, strCmd
As
String
Dim
vTZI
As
Variant
Const
cRegKey
As
String
=
""
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
""
Const
cTZI
As
String
=
""
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\New Zealand Standard Time"
""
sngLRegKey = Len(cRegKey)
strCmd =
"cmd /c REG QUERY "
& cRegKey &
" /se #"
TimeZoneList = Split(CreateObject(
"wscript.shell"
).exec(strCmd).stdout.readall, vbCrLf)
sngTZNr = UBound(TimeZoneList)
For
i = 4
To
sngTZNr
strText = strText & Mid(TimeZoneList(i), sngLRegKey) & vbCrLf
Next
i
strCmd =
"cmd /c REG QUERY "
& cTZI &
" /v "
&
"TZI"
TZIFull = Split(CreateObject(
"wscript.shell"
).exec(strCmd).stdout.readall, vbCrLf)
TimeZoneInfo = Split(TZIFull(2),
" "
)
vTZI = TimeZoneInfo(3)
MsgBox vTZI
End
Sub