Script to change time zone?

  • Thread starter Thread starter mlcooper
  • Start date Start date
M

mlcooper

Does anyone know of a script that will change the time zone of a
windows xp sp2 machine? I'm going to need to change the timezone on
about 50 machines all on the same day, and I was wondering if there is
a script out there that will do this for me to speed up the process.
 
How are they getting time changes now? Are they synchronizing with MS
servers? Are they connected to the internet?
Are they connecting to a local server?
 
Search on these and you will find what you need:

RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z

CONTROL.EXE TIMEDATE.CPL,,/Z

John
 
Search on these and you will find what you need:

RunDLL32 shell32.dll,Control_RunDLL %SystemRoot%\system32\TIMEDATE.cpl,,/Z

CONTROL.EXE TIMEDATE.CPL,,/Z

John





- Show quoted text -

I figured it out. Here is what I did. I manually changed the time
zone in the control panel to the time zone I'm going to need
(Barcelona, Spain), and exported the timezone key from the registry
(HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation). I also
exported my current Eastern Time zone settings from this same key and
put it in a different reg file.

I then got the timezone database refresh script from Microsoft and
wrote my .bat file. So the .bat file to change the time zone first
merges the reg key with the timezone information that I want, and then
runs a .vbs script to refresh the timezone database. It seems to work
perfectly.
 
I figured it out. Here is what I did. I manually changed the time
zone in the control panel to the time zone I'm going to need
(Barcelona, Spain), and exported the timezone key from the registry
(HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation). I also
exported my current Eastern Time zone settings from this same key and
put it in a different reg file.

I then got the timezone database refresh script from Microsoft and
wrote my .bat file. So the .bat file to change the time zone first
merges the reg key with the timezone information that I want, and then
runs a .vbs script to refresh the timezone database. It seems to work
perfectly.

Yes, that will work. Just make sure that you have the right information
in the keys. There have been a lot of people with time zone problems
after the recent changes.

John
 
I don't know if it's a coincidence or not, but lately I have been unable to
get either of my two machines to sync with either of the internet time
servers I usually use (MS, and NIST). I get an error message that says that
"the peer's stratum is less than the host's stratum."

I can't find mention of this error message anywhere. Anyone have a clue?
I'm running XP SP2 on both of them, and used to be able to automatically
update the time.
 
Try these at a Command Prompt, pressing enter after each:

w32tm /config /syncfromflags:manual /manualpeerlist:time.nist.gov,0x8

w32tm /config /update

w32tm /resync


In the first command you can change the time.nist.gov server with your
preferred server, or you can have more than one server if you separate
them by commas.

John
 
Back
Top