Answered Apply Daylight Saving Time

  • Tuesday, May 08, 2012 3:22 AM
     
     
    Hi !

    I have to remove the checkbox for Automatic Daylight Saving Time (win xp sp3)

    The Following Registry Code simply works



    Windows Registry Editor Version 5.00


    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]

    "DisableAutoDaylightTimeSet"=dword:00000001


    it removes the tick

    but i need to open the time window (double click on time in corner of screen) and i must go to time zone tab and just click ok

    then the time will get back and set fine

    is it anyway to get rid of that or do that automatically by a script or .. ?

    I tried this one but it put the tick back again and refresh it (opposite to what i like to do)

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

All Replies

  • Tuesday, May 08, 2012 6:25 AM
     
     
    yes this can be done, you need to create 2 registry keys.. This is not recommended though...

    Regards, h9ck3r.

  • Tuesday, May 08, 2012 6:29 AM
     
     

    thanks

    how can i do that ?

    what are those registry keys ?

  • Tuesday, May 08, 2012 6:34 AM
     
     Answered

    M.Ganji,

                 go through this link : http://computeradvisors.net/knowledge-base/change-daylight-saving-settings-on-windows-machines-via-command-or-batch-file

    I have not tried the above solution and i am not sure if it works. I suggest you to backup your registry first and do the change.


    Regards, h9ck3r.

    • Marked As Answer by MohammadG Tuesday, May 08, 2012 6:46 AM
    •  
  • Tuesday, May 08, 2012 6:46 AM
     
     

    Great and Great And Great

    You Made My Day

    a very simple idea

    change it to a different location and change it back

    thank you again