Batch File for Windows Date and Time - Dual Boot


  1. Posts : 3
    windows 7 home premium
       #1

    Batch File for Windows Date and Time - Dual Boot


    Morning All,

    A long time reader and user of advice on the forum but in need of advice if possible.

    Long story short but for work purposes I have to have a Win 7 dual boot system that I need to log in and change the time to USA regional time on one of my setups.

    A number of times I have inadvertently forgot to change my time and date settings and either cant login to my secure network or when sending emails I get errors messages due to time and date settings.

    Is there anyway I can add in a batch command on start up to setup the local date and time ?

    Any advice much appreciated
      My Computer


  2. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #2

    Hi Lewis, and welcome to Sevenforums,

    What exact timezone are you after?

    To change the current timezone setting to, for example, the Central America Standard Time (UTC-06:00), the command would be
    Code:
    tzutil /s "Central America Standard Time"
    A list of valid timezone IDs can be viewed via tzutil /l.

    Once you have the command you need, simply wrap the command into a batch file then place the script into the Startup folder.
      My Computer


  3. Posts : 3
    windows 7 home premium
    Thread Starter
       #3

    Thank you vey much worked a treat.

    Is there anyway to then force it to do a check against an internet time site to make sure it is current?
      My Computer


  4. Posts : 20,583
    Win-7-Pro64bit 7-H-Prem-64bit
       #4

    Hi,
    What type of dual boot are you using,
    The only type I can think of that would change the time would be a Linux in dual boot with windows :/
    Been there :)
    Cheers.
      My Computer


  5. Posts : 3
    windows 7 home premium
    Thread Starter
       #5

    Sorry yes it is a Linux/windows boot
      My Computer


  6. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #6

    lewis94 said:
    Is there anyway to then force it to do a check against an internet time site to make sure it is current?
    Are we now talking about setting the actual datetime?

    If you're connected to a network you can run a simple command to sync your time with that of another Windows machine on the network. It's the easiest way.
    Code:
    net time \\ComputerName /set /yes
    Note: changing the datetime requires administrator privileges. An elevated command prompt may be required.


    Checking your machine's time against an internet time server can be done through batch (with the help of a few powershell calls), but it's not so straight forward of a task.
      My Computer


  7. Posts : 20,583
    Win-7-Pro64bit 7-H-Prem-64bit
       #7

    lewis94 said:
    Sorry yes it is a Linux/windows boot
    Okay yes I had the same issue,
    The solution is posted in Newbie questions here,

    My question is now at the bottom of page 2,
    "Solved" Clock 6 hours advanced switching back to win-7
    Linux Mint Forums
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:53.
Find Us