Set objSh = CreateObject("WScript.Shell") 'Get the StandardName key of the current time zone szStandardName = objSh.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\StandardName") 'Enumerate the subkeys in the time zone database const HKEY_LOCAL_MACHINE = &H80000002 Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") szTzsKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" objReg.EnumKey HKEY_LOCAL_MACHINE, szTzsKeyPath, arrTzSubKeys 'Step through the time zones to find the matching Standard Name szTzKey = "" For Each subkey In arrTzSubKeys If (objSh.RegRead("HKLM\" & szTzsKeyPath & "\" & subkey & "\Std") = szStandardName) Then 'Found matching StandardName, now store this time zone key name szTzKey = subkey End If Next If szTzKey = "" Then 'Write entry to the Application event log stating that the update has failed to execute objSh.LogEvent 1, "DST 2007 Registry Update and Refresh failed to execute on this computer. " & _ "Time zones failed to enumerate properly or matching time zone not found." Wscript.Quit 0 End If Dim process, processid, result, strUpdateCommand Set process = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2:Win32_process") 'Add time change privilege to the process object process.Security_.Privileges.AddAsString "SeSystemTimePrivilege",True strUpdateCommand = "control.exe timedate.cpl,,/Z" & szTzKey 'Launch control.exe to refresh time zone information using the TZ key name obtained above result = process.create(strUpdateCommand,Null,Null,processid) If result <> 0 Then objSh.LogEvent 1, "DST 2007 Registry Update and Refresh failed to execute on this computer." & _ "Unable to refresh the Timezone database." Wscript.Quit 0 End If 'Get current display name of refreshed time zone szCurrDispName = objSh.RegRead("HKLM\" & szTzsKeyPath & "\" & szTzKey & "\Display") 'Write entry to the Application event log stating that the update has executed objSh.LogEvent 4, "DST 2007 Registry Update and Refresh has been executed on this computer." & chr(13) & chr(10) & chr(13) & _ chr(10) & "Current time zone is: " & szCurrDispName & "."