Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch file to disable Daylight saving time for remote machine  (Read 15735 times)

0 Members and 1 Guest are viewing this topic.

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Batch file to disable Daylight saving time for remote machine
« on: September 08, 2015, 10:39:32 PM »
Dear all,

I made a batch file to disable daylight saving time for a remote machine, "the machine is using windows xp service pack 2"  as figure 1 and 2 but after using it and rebooting this machine i found The daylight saving time "check box" is unchecked successfully but the machine still using daylight saving time as figure 3  , i dont know why that happened and why don't affect
If any one has any idea to do real different please help
the Batch file and the screen shoot for the Impact is here


[attachment deleted by admin to conserve space]

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: Batch file to disable Daylight saving time for remote machine
« Reply #1 on: September 09, 2015, 06:27:09 AM »
When is the last time the computer synced with a Time Server?  You seem to be missing that tab in the Date and Time Properties Window.

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Batch file to disable Daylight saving time for remote machine
« Reply #2 on: September 09, 2015, 06:42:59 AM »
Also i believe when that box is unticked the time stays set to the current window...
" Anyone who goes to a psychiatrist should have his head examined. "

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #3 on: September 10, 2015, 03:17:45 PM »
When is the last time the computer synced with a Time Server?  You seem to be missing that tab in the Date and Time Properties Window.

Dear Squashman ,
there is no issue  with synchronization with the server but some times the machines lost this syncing and we must fix this issue so i want to make (a batch file to disable daylight saving time for every machine as a variable) and make other( batch to do that for all machines in one click)
and as i said before my batch i working and give me message successfully but i can't see any impact on the machine as you see in previous figures and my attached batch.
So, if you want to help for editing the batch or any suggestion‏  please i am listening for you.

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #4 on: September 10, 2015, 03:21:04 PM »
Also i believe when that box is unticked the time stays set to the current window...

Dear patio,

I can't understand what you said so please explain more.

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Batch file to disable Daylight saving time for remote machine
« Reply #5 on: September 10, 2015, 04:16:43 PM »
Dear patio,

I can't understand what you said so please explain more.

It was 6:49 when unticked...it was 6:52 in your last screenshot...in other words the time does not change when the setting is changed...
" Anyone who goes to a psychiatrist should have his head examined. "

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #6 on: September 11, 2015, 09:58:39 AM »
It was 6:49 when unticked...it was 6:52 in your last screenshot...in other words the time does not change when the setting is changed...

patio
if have idea to edit the batch or create other batch with other batch codes to do real change plz help. 

Salmon Trout

  • Guest
Re: Batch file to disable Daylight saving time for remote machine
« Reply #7 on: September 11, 2015, 10:05:53 AM »
Will the time change, just because you disable DST? I have a feeling that the main effect is that, the next date the clocks change, the system does not alter the time.

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #8 on: September 11, 2015, 12:14:13 PM »
Will the time change, just because you disable DST? I have a feeling that the main effect is that, the next date the clocks change, the system does not alter the time.

Ok Salmon Trout

Where is the key related to DST in registry in windows XP and how to make it disabled.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Batch file to disable Daylight saving time for remote machine
« Reply #9 on: September 11, 2015, 01:00:00 PM »
Will the time change, just because you disable DST? I have a feeling that the main effect is that, the next date the clocks change, the system does not alter the time.

That's perceptive.

@Abo-Zead  You want to change the time zone figure.

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #10 on: September 11, 2015, 04:38:10 PM »
That's perceptive.

@Abo-Zead  You want to change the time zone figure.


yes foxidrive,

you want to help or what are you meaning by That's perceptive
and I want to disable daylight saving time key only not all time zones keys could you help

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Batch file to disable Daylight saving time for remote machine
« Reply #11 on: September 11, 2015, 06:44:51 PM »
what are you meaning by That's perceptive

I meant that the task has two portions and you are only doing one of them.
Salmon Trout recognised that.

As well as disabling the automatic changing of daylight savings, presuming that is what you want to do, then the second part is that you have to restore the correct timezone in Windows to get the time back to what it should be (assuming it is daylight saving time of year when you disable the automatic change).

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #12 on: September 11, 2015, 07:43:03 PM »
I meant that the task has two portions and you are only doing one of them.
Salmon Trout recognised that.

As well as disabling the automatic changing of daylight savings, presuming that is what you want to do, then the second part is that you have to restore the correct timezone in Windows to get the time back to what it should be (assuming it is daylight saving time of year when you disable the automatic change).

Dear foxidrive

Could you tell me what are the name of keys must be changed and Where it's path in registry editor .
my local time zone is Cairo in Egypt

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #13 on: September 11, 2015, 09:32:13 PM »
Some things of interest.
DST is not an option in all time zones.
See here:
Time zones that do not observe daylight saving time
Quote
Assume that you live in a region that does not observe daylight saving time (DST), but the Windows setting for that time zone does adjust for daylight saving time. In this situation, we recommend that you do not clear the Automatically adjust clock for Daylight Saving Time check box in the Time Zone Settings dialog box.
The above contains a link to:
Daylight Saving Time Help and Support Center
Quote
Daylight saving time (DST), and "Summer Time" in much of Europe, is the practice of moving local time forward one hour in the spring and backwards in the autumn. These spring and autumnal shifts to DST are different between northern and southern hemispheres. The start of DST in the northern hemisphere is usually in March or April (depending on the country/continent), and ending in October or November. In the southern hemisphere, the changes are the opposite, with DST beginning in October and ending in March or April.
Most countries of the world do not use DST.  Thus, those places do not have a definition of  DST.  Therefore in such areas DST  should not be used and may give unexpected results, r even no charges.
Each location can have its own rules for DST.
This link relates to Ciro, Egypt.
Time zone in Cairo, Egypt (Al Qâhirah)
Note the table for Cairo, Egypt DST  is not the same as some other nearby  areas. It is very different from what one might expect.

Hop this is of some help.   :)
« Last Edit: September 11, 2015, 09:48:15 PM by Geek-9pm »

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #14 on: September 12, 2015, 11:12:43 AM »
Some things of interest.
DST is not an option in all time zones.
See here:
Time zones that do not observe daylight saving timeThe above contains a link to:
Daylight Saving Time Help and Support CenterMost countries of the world do not use DST.  Thus, those places do not have a definition of  DST.  Therefore in such areas DST  should not be used and may give unexpected results, r even no charges.
Each location can have its own rules for DST.
This link relates to Ciro, Egypt.
Time zone in Cairo, Egypt (Al Qâhirah)
Note the table for Cairo, Egypt DST  is not the same as some other nearby  areas. It is very different from what one might expect.

Hop this is of some help.   :)


Dear Geek

thank you for your advice and your effort but my question here can me do what i want by using batch only or not and if i can  do that could you help me in writing this batch.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Batch file to disable Daylight saving time for remote machine
« Reply #15 on: September 12, 2015, 05:46:10 PM »
This may help you:

Code: [Select]
c:\>tzutil /?
Windows Time Zone Utility

Usage:
TZUTIL </? | /g | /s TimeZoneID[_dstoff] | /l>

Parameters:
    /? Displays usage information.

    /g Displays the current time zone ID.

    /s TimeZoneID[_dstoff]
       Sets the current time zone using the specified time zone ID.
       The _dstoff suffix disables Daylight Saving Time adjustments
       for the time zone (where applicable).

    /l Lists all valid time zone IDs and display names. The output will
       be:
           <display name>
           <time zone ID>

Examples:
    TZUTIL /g
    TZUTIL /s "Pacific Standard Time"
    TZUTIL /s "Pacific Standard Time_dstoff"

Remarks:
    An exit code of 0 indicates the command completed successfully.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #16 on: September 12, 2015, 10:01:53 PM »
The Windows Time Zone Utility is available as a download from MS.
http://www.microsoft.com/en-us/download/details.aspx?id=25166
However, it may have issues:
http://blogs.msdn.com/b/cjacks/archive/2009/12/16/windows-7-debugging-demo-troubleshooting-the-broken-microsoft-time-zone-utility.aspx
Here is a command line example:
http://stackoverflow.com/questions/16656229/how-do-i-set-the-timezone-from-command-line

Bear in mind that the eastern Europe usage is not universal. And in other areas also. This year is a real mind bender.

Daylight Saving Time Around the World 2015


Rather than pure batch, many administrators are using Powershell.
Powershell is in all current versions of Windows and has many features from the .NET library.
A few:
https://gist.github.com/chrisbenti/11036644
http://stackoverflow.com/questions/11035905/powershell-display-current-time-with-time-zone
https://technet.microsoft.com/en-us/library/hh849887.aspx
http://powershell.com/cs/blogs/tips/archive/2013/08/13/changing-current-time-zone.aspx
As can been seen, the  scripts are not trivial. So pure batch may be very hard, if even possible. IMHO the Powershell scripts should be considered.  :)

Sorry, I can not do the code for you. I am very slow to code. I takes me three days to do what some here can do in an afternoon.  :'(

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Batch file to disable Daylight saving time for remote machine
« Reply #17 on: September 13, 2015, 03:13:59 PM »
The Windows Time Zone Utility is available as a download from MS.
http://www.microsoft.com/en-us/download/details.aspx?id=25166
However, it may have issues:
http://blogs.msdn.com/b/cjacks/archive/2009/12/16/windows-7-debugging-demo-troubleshooting-the-broken-microsoft-time-zone-utility.aspx

You've made it very easy for me to check by providing the links - and those refer to downloads for XP (and server 2003).

Just commenting here if people stumble across this thread looking for info in the future, that it's not for current versions of Windows.

I do see that Abo-Zead is using XP though.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #18 on: September 13, 2015, 05:42:53 PM »
Hope you  can help him. :)
In non-western countries, the DST is more difficult.
Local conditions alter the way it is used. Microsoft is aware of the problem and has some information about how to fix it for Egypt this year.
Last year:
2014 - Egypt Ramadan DST changes - Fix it
This yer:
2015 - Egypt DST changes - hotfix
I found these  with a Google on:
how does windows do DST in Egypt
It seems many administrators in Egypt have issues with DST.

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #19 on: September 17, 2015, 10:54:30 AM »
     Dear all,

         thank you for your assistance and appreciate that and after explore some pages that you provide it to me i understood a little of things  And I hope that you read my post carefully well So i'll explain my issue again ( all machines have synchronized with the server in time but some times some machines lost this syncing and enable daylight saving time I mean +1 hour but all machines have the same time zone even the machines that lost syncing ( Egypt Standard Time ) and and i want to return the time as before  by disabling daylight saving time or by any way so i did restart it remotely to re-syncing and nothing happened and create the batch attached to disable DST and restart it remotely and also nothing happened, only the remote access can do that but i want to do that by using remotely batch.
NOT: my created batch can disable DST for remotely machine but can't apply that actually as figures in the first post.
      : machines have Windows XP SP2.

So Could any one create a batch to disable DST and apply that for remotely machine actually .

thanks again for your support

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #20 on: September 17, 2015, 02:54:19 PM »
This may be of interest:
http://www.timeanddate.com/worldclock/egypt/alexandria

Alexandria, Egypt does not use the DST of Cairo.
My guess is that Windows has some problem doing DST for Egypt. And remember that Windows XP is no longer supported by Microsoft.

Therefore, you may have to set all machines to Alexandria, Egypt. Doing so should shut off the DST.

I can not test this. Here is another reference:
https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/int_pr_custom_workspace_regionalsettings.mspx?mfr=true
From there go to the place where is says:
Change the way your computer displays the time

Speculation: Setting the time off by twenty minuets may cause  the machine to sync again with the server.

Please keep us posted.

EDIT:
Try this  Google search:
https://www.google.com/search?q=force+remote+XP++to+not+use+DST&ie=utf-8&oe=utf-8
It seems the XP DST trouble is not limited to Egypt or any location. It is impossible to turn off  DST in Windows XP by remote. One of the links mentions Egypt, but the problem is also in other places.
http://itproafrica.com/technology/windows/disabling-daytime-savings-microsoft-windows-egypt-dst/
 
« Last Edit: September 17, 2015, 03:20:33 PM by Geek-9pm »

Abo-Zead

    Topic Starter


    Beginner
  • Thanked: 1
  • Experience: Familiar
  • OS: Windows 10
Re: Batch file to disable Daylight saving time for remote machine
« Reply #21 on: September 23, 2015, 10:18:44 PM »
Dear all,

could any one help me to do this code " TZUTIL /s "Pacific Standard Time_dstoff" in remotely machine.

by batch file only

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Batch file to disable Daylight saving time for remote machine
« Reply #22 on: September 23, 2015, 10:23:02 PM »
could any one help me to do this code " TZUTIL /s "Pacific Standard Time_dstoff" in remotely machine.
by batch file only

What remote access software can be used?  PSEXEC?

Edit:

It looks like tzutil is not a tool that you can use on XP.

https://technet.microsoft.com/en-us/library/hh825053.aspx
Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2
« Last Edit: September 23, 2015, 10:53:52 PM by foxidrive »