Problem with Auto Adjust for Daylight Savings

G

Guest

Hello everyone,

I administer roughly 70 Windows XP Professional workstations on a network
that, when
initially installed, did not have the "Automatically adjust clock for
daylight saving changes" box checked in the Time Zone settings. I managed to
deploy the following registry setting to all affected computers
(HKLM\System\CurrentControlSet\Control\TimeZoneInformation\DisableAutoDaylightTimeSet=0).
However, the time does not actually adjust itself properly until I
physically log into the workstation, open the system date/time applet and
then click OK. Does anyone know of a way that this can be automated? Users
on this network do not have administrative rights, and I cannot imagine
having to log in to each machine individually to update the time. I've done
some exhaustive research but have come up with nothing. Hopefully it's
something I've accidentally overlooked. Does anyone know?

Much appreciated,
Adam
 
J

JFHottel

Microsoft provided a VBscript to manually update machines fir the DST
patch. If you run a batch file that deletes or changes the reg key you
mentioned, then run the vbscript, it forces the machine to reload the
info. I can't find a link to the file, so here is the code...

************
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 = "<Unknown>"
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 = "<Unknown>" 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

'Launch control.exe to refresh time zone information using the TZ key
name obtained above
objSh.Run "control.exe timedate.cpl,,/Z" & szTzKey

'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 & "."

******

create a .vbs file with that inside, and if you are like me you will
probably have to call it with the csript command from a login script.
The only part that is prob really needed is the
'Launch control.exe to refresh time zone information using the TZ key
name obtained above
objSh.Run "control.exe timedate.cpl,,/Z" & szTzKey
part.

Hope this works for you.



John Hottel
 
G

Guest

That was it. Thanks!

Microsoft provided a VBscript to manually update machines fir the DST
patch. If you run a batch file that deletes or changes the reg key you
mentioned, then run the vbscript, it forces the machine to reload the
info. I can't find a link to the file, so here is the code...

************
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 = "<Unknown>"
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 = "<Unknown>" 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

'Launch control.exe to refresh time zone information using the TZ key
name obtained above
objSh.Run "control.exe timedate.cpl,,/Z" & szTzKey

'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 & "."

******

create a .vbs file with that inside, and if you are like me you will
probably have to call it with the csript command from a login script.
The only part that is prob really needed is the
'Launch control.exe to refresh time zone information using the TZ key
name obtained above
objSh.Run "control.exe timedate.cpl,,/Z" & szTzKey
part.

Hope this works for you.



John Hottel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top