Computer Hope

Microsoft => Microsoft DOS => Topic started by: Abo-Zead on September 08, 2015, 10:39:32 PM

Title: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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]
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Squashman 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: patio on September 09, 2015, 06:42:59 AM
Also i believe when that box is unticked the time stays set to the current window...
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: patio 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...
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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. 
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Salmon Trout 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: foxidrive 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: foxidrive 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).
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Geek-9pm 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 (https://support.microsoft.com/en-us/kb/982987)
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 (https://support.microsoft.com/en-us/gp/cp_dst)
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) (http://www.timeanddate.com/time/zone/egypt/cairo)
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.   :)
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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 time (https://support.microsoft.com/en-us/kb/982987)The above contains a link to:
Daylight Saving Time Help and Support Center (https://support.microsoft.com/en-us/gp/cp_dst)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) (http://www.timeanddate.com/time/zone/egypt/cairo)
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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: foxidrive 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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Geek-9pm 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 (http://www.timeanddate.com/time/dst/2015.html)

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.  :'(
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: foxidrive 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 (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 (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.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Geek-9pm 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 (https://support.microsoft.com/en-us/kb/2967990)
This yer:
2015 - Egypt DST changes - hotfix  (https://support.microsoft.com/en-us/kb/3066710)
I found these  with a Google on:
how does windows do DST in Egypt
It seems many administrators in Egypt have issues with DST.
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Geek-9pm 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/
 
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: Abo-Zead 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
Title: Re: Batch file to disable Daylight saving time for remote machine
Post by: foxidrive 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