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 15740 times)

0 Members and 1 Guest are viewing this topic.

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 »