Page 1 of 1 1
Topic Options
#46991 - 2003-10-19 04:18 PM Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
hello,

i've got a little problem at my company..
i live in the nederlands and the clock uses Daylight saving changes. In the summer is it GMT +2 and in the winter is it GMT +1

but automatically adjustment is disabled on all my computers, so i created this script:

code:
 


If ExistKey ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation") =0
$Autodaylight = ReadValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DisableAutoDaylightTimeSet")
If $Autodaylight = "1"
DelValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DisableAutoDaylightTimeSet")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DayLightName","W. Europe Daylight Time","Reg_SZ")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","ActiveTimeBias","ffffff88","REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DaylightBias","ffffffc4","REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DaylightStart","00 00 03 00 05 00 02 00 00 00 00 00 00 00 00 00","REG_BINARY")

EndIf
EndIf




can anybody tell me of this will work??? i have to implement this next week.

by the way, if i adjust it manually, all appointments moves 1 hour forward...

thnx in regard,

marcel

message added for use with code button

[ 19. October 2003, 16:33: Message edited by: Marcel Henderik ]

Top
#46992 - 2003-10-19 04:27 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
PS,

the clients are Windows XP...

Top
#46993 - 2003-10-19 04:27 PM Re: Change Daylight saving changes
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Marcel,

Please, when posting code, please use the CODE Button below to place your code between the [CODE]..[/CODE] tags.

Will this work?

What happens when you test it? Do your users have rights to do so? Generally speaking, HKLM, you would need Administrative access to write to this key of the registry.

With your DELVALUE, WRITEVALUE, etc. you should preceed the command with a $RC= or equivalent to suppress the results for your users. Having this off for the time being is good to see the results.

The REG_BINARY, should be -

"00000300050002000000000000000000"

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#46994 - 2003-10-19 04:32 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
sorry,

next time i will use the code button..

all my users are at this time local admin so, that would not cause a problem.

when i run the script, the adjustment are made, but, my time will not jump one hour forward (still summertime), but when i made the adjustment manually, the time will jump...

quote:

The REG_BINARY, should be -

"00000300050002000000000000000000"


ok thnx. i will made the adjustment..

[ 19. October 2003, 16:34: Message edited by: Marcel Henderik ]

Top
#46995 - 2003-10-19 04:54 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
ok, when i press the OK button (de button with you see when you dubble click the time) after running the script, it will adjust the the time with one hour...
Top
#46996 - 2003-10-19 06:24 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
nobody any idea?
Top
#46997 - 2003-10-19 07:30 PM Re: Change Daylight saving changes
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Not sure what you expect... that is expected behaviour. Why would you expect the OS to react to a reg hack?

I imagine when the computer is rebooted, that it will have the correct time. You could try issueing a NET TIME or a W32TM -ONCE from the SHELL if you want to see results without a reboot.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#46998 - 2003-10-19 08:21 PM Re: Change Daylight saving changes
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4629
Loc: The Netherlands
A reboot should indeed do the trick, if all the correct settings are changed by your script. You can use some thing like regshot to check the values changed when you set it manually.

When this is enabled deploying some sort of auto time synchronization might also be a good thing.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#46999 - 2003-10-19 09:05 PM Re: Change Daylight saving changes
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
However, a registry refresh might do the trick, too. Registry refreshes are for example done when killing/restarting explorer.exe. See http://is-it-true.org/nt/registry/rtips315.shtml
_________________________
There are two types of vessels, submarines and targets.

Top
#47000 - 2003-10-20 06:01 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
Sorry, but even a reboot doen't do the trick..
also a resync of the time doens't doe the trick

why windows should accept this trick?? how else kan i make an ajustment with the time zone.

i acutally want te place just one ajustment with you're timezone information, cause my customer makes one huge mistake, 5 years ago....

ikm just a cleaner...

Top
#47001 - 2003-10-21 07:01 AM Re: Change Daylight saving changes
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You can apply these changes by hand, right?

If we look at KiXtart FAQ & How to's

We see Registry Tools

and specifically Regshot

So, you should see the before and after effects and record these.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47002 - 2003-10-21 09:12 AM Re: Change Daylight saving changes
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1338
Loc: NL
Marcel,

You can also use Advanced Registry Tracert. Cann't you used the net time command?

[ 21. October 2003, 09:14: Message edited by: Co ]
_________________________
Co


Top
#47003 - 2003-10-21 10:02 AM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
i wish that nettime works, but it looks like he misses some adjusment..

wel, witg regshot i saw some more keys and values then i saw with regsnap (the tool witch i normally uses..)

code:
Values deleted:2 
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DisableAutoDaylightTimeSet: 0x00000001
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DisableAutoDaylightTimeSet: 0x00000001


Values modified:8
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DaylightName: "W. Europe Standard Time"
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DaylightName: "W. Europe Daylight Time"
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DaylightBias: 0x00000000
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DaylightBias: 0xFFFFFFC4
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DaylightStart: 00 00 0A 00 05 00 03 00 00 00 00 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\DaylightStart: 00 00 03 00 05 00 02 00 00 00 00 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\ActiveTimeBias: 0xFFFFFFC4
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation\ActiveTimeBias: 0xFFFFFF88
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DaylightName: "W. Europe Standard Time"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DaylightName: "W. Europe Daylight Time"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DaylightBias: 0x00000000
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DaylightBias: 0xFFFFFFC4
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DaylightStart: 00 00 0A 00 05 00 03 00 00 00 00 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\DaylightStart: 00 00 03 00 05 00 02 00 00 00 00 00 00 00 00 00
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias: 0xFFFFFFC4
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias: 0xFFFFFF88

im going to try those...

let you know wat happens,

ps, sorry for my english.... this costs me a lot of my regular sleep at night..

Top
#47004 - 2003-10-21 11:09 AM Re: Change Daylight saving changes
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1338
Loc: NL
Well we could talk to each other in Dutch but there are +/- 5.000.000.000 - 21.000.000 people who cann't help you then. So don't worry about your english.... [Big Grin]

[ 21. October 2003, 11:50: Message edited by: Co ]
_________________________
Co


Top
#47005 - 2003-10-22 12:25 AM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
hehehe we really could, but i rather keep it in english so the that the others might try to understand me, but i FOUND my bug!!!!

code:
If ExistKey ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation") =0
$Autodaylight = ReadValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DisableAutoDaylightTimeSet")
If $Autodaylight = "1"
DelValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DisableAutoDaylightTimeSet")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DayLightName","W. Europe Daylight Time","Reg_SZ")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","ActiveTimeBias","0xFFFFFF88","REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DaylightBias","0xFFFFFFC4","REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DaylightStart","00000300050002000000000000000000","REG_BINARY")
Shell "%COMSPEC% /c net time \\server /set"
EndIf
EndIf

by DaylightBias it must be 0xFFFFFF88.. but i wrote: ffffff88.. well that doens't do the trick [Smile]

and that costed me almost a week.. pfff...
i uses the older version of regsnap and it gaves me the output i usses..ffffff88

thnx anybody for you're help!

now i need some more coffee.

Top
#47006 - 2003-10-21 01:02 PM Re: Change Daylight saving changes
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1338
Loc: NL
MMM, I think you can laid back for the rest of the week since Wintertime starts next saturday... [Big Grin]
_________________________
Co


Top
#47007 - 2003-10-21 01:27 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
ghehhe allmost...
just need to find out why my server can't synchronise with a timeclock on the internet. [Frown]

problably a firewall rule... but therefore i need to contact the ISP.

then i take some rest [Smile]

Top
#47008 - 2003-10-21 02:31 PM Re: Change Daylight saving changes
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Marcel,

You posted that 0xFFFFFF88 was the needed step..

Let's get some help from the documentation here.

If we do some digging under READVALUE...

"REG_DWORD variables are returned in decimal format"

Wouldn't that mean that these can also be written in Decimal Format?

For example, I see 4294967236 (FFFFFFC4) using Registry Commander.

So, we take your FFFFFF88 into Windows Calculator as a Hex and get 4294967176 in Decimal.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#47009 - 2003-10-21 05:42 PM Re: Change Daylight saving changes
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
But you could also supply the HEX value instead, thus the &H moniker.
_________________________
There are two types of vessels, submarines and targets.

Top
#47010 - 2003-10-22 07:51 PM Re: Change Daylight saving changes
Marcel Henderik Offline
Fresh Scripter

Registered: 2003-03-11
Posts: 14
Loc: Netherlands
im not such a specialist in KIX... so [Smile]

but maybe it's strange but this works:

code:
  
If ExistKey ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation") =0
$Autodaylight = ReadValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DisableAutoDaylightTimeSet")
If $Autodaylight = "1"
DelValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DisableAutoDaylightTimeSet")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DayLightName","W. Europe Daylight Time","Reg_SZ")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","ActiveTimeBias","0xFFFFFF88","REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DaylightBias","0xFFFFFFC4","REG_DWORD")
WriteValue ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation","DaylightStart","00000300050002000000000000000000","REG_BINARY")
Shell "%COMSPEC% /c net time \\Testsrv /set"
EndIf
EndIf


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 177 anonymous users online.
Newest Members
dboozcruise, 2786707460, Marc57, EricMyers, siddharthinfosy
17519 Registered Users

Generated in 0.239 seconds in which 0.103 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org