asked on
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_MULTI_SZ = 7
uBinary = Array(&Ha8,&Hfd,&Hff,&Hff,&H00,&H00,&H00,&H00,&Hc4,&Hff,&Hff,&Hff,&H00,&H00,&H04,&H00,&H00,&H00,&H01,&H00,&H03,&H00,&H00,&H00,&H00,&H00,&H00,&H00,&H00,&H00,&H0a,&H00,&H00,&H00,&H01,&H00,&H02,&H00,&H00,&H00,&H00,&H00,&H00,&H00)
' Chose computer name, registry tree and key path
'
strComputer = "." ' Use . for current machine
hDefKey = HKEY_CURRENT_USER
strKeyPath = "Software\Citrix\SessionTimeZone\"
' Connect to registry provider on target machine with current user
'
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
' Enum the subkeys of the key path we've chosen
'
oReg.EnumKey hDefKey, strKeyPath, arrSubKeys
For Each strSubkey In arrSubKeys
strKeyPath = strKeyPath + strSubkey
oReg.SetStringValue hDefKey, strKeyPath, "Display", "AUS Eastern Standard Time"
oReg.SetStringValue hDefKey, strKeyPath, "Dlt", "AUS Eastern Daylight Time"
oReg.SetBinaryValue hDefKey, strKeyPath, "TZI", uBinary
oReg.SetDWORDValue hDefKey, strKeyPath, "UseRegTimeZone", "00000001"
Next