[HOWTO] Dual Booting & Windows System Time Incorrect

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
Mister Cabbage

[HOWTO] Dual Booting & Windows System Time Incorrect

Post by Mister Cabbage »

Purpose: How to automatically correct windows time clock with a batch file and task scheduler. This is my personal workaround.

Why: After I've personally setup a dual boot scenario on my pc, I noticed Windows no longer behaves and has correct time on the system tray, unless I went ahead and manually updated it myself. Annoying and just another reason for me not to bother with Windows unless absolutely necessary. But I did finally get around to looking into a solution and wanted to pass on the knowledge in case anybody else is having the same problem.

Assumptions: This assumes you are indeed dual booting between linux and windows, of course. Furthermore, it assumes that you are also noticing that after successfully dual booting, that windows time stops synchronizing correctly. I don't remember the exact cause, but it is related to dual booting and doesn't occur when running windows alone, at least not for me. I think dual booting affects how Windows communicates with the motherboard for date/time settings before syncing on the internet. I'm also assuming you are running Windows 10 in the same manner as I am, with an admin account, and a standard account. I did the following steps under my standard account and entered the admin password where prompted.



Step 1.

Navigate to C:\



Step 2.

Create a folder named "batch" or "myscripts"



Step 3. Go into the folder created in Step 2 and make a txt file named "WIN TIME"



Step 4. Open txt file named "WIN TIME" and paste the following code:



net stop w32time
net start w32time
w32tm /config /manualpeerlist:129.6.15.28,0x8 /syncfromflags:MANUAL /reliable:yes /update
w32tm /resync /rediscover
net stop w32time
net start w32time




Step 5. Save the txt file and close the notepad window



Step 6. Right click on the txt file and change txt extension to bat



Step 7. If step 6 was done correctly the file should now appear as WIN TIME.bat



Step 8. Go to Start Menu and type Task Scheduler. Make sure to run it as administrator



Step 9. After Task Scheduler opens, navigate the mouse cursor to the top right where you should see a panel named "Actions".



Step 10. Under the Actions panel click on "Create Task".



Step 11. A popup window named "Create Task" should have opened.



Step 12. In the field for Name: enter something like "WIN TIME" or "WIN TIME FIX" without the quotation marks.



Step 13. Ignore the field labeled "Location"



Step 14. Optionally, add a description for the task in the description field.



Step 15. Towards the bottom of the Create Task window, there are two radial buttons. One is defined as "Run only when user is logged on". The other is labeled as "Run whether user is logged on or not".



Step 16. Select the button labeled "Run whether user is logged on or not"



Step 17. Ignore the tickable box labeled "Do not store password. The task will only have access to local computer resources". I'm not entirely sure, but it may interfere with the script syncing time on the internet. Just leave that box unchecked.



Step 18. There is another tickable box labeled "Run with the highest privaledges" You want that selected.



Step 19. Leave tickable box for Hidden unchecked.



Step 20. To the right of hidden there is a label "Configure For" with a drop down menu. Click on the drop down menu and select Windows 10.



Step 21. Navigate your mouse back to the top of the Create Task window where you should see tabs labeled "General, Triggers, Actions, Conditions, Settings, and History".



Step 22. Click on the tab labeled "Triggers"



Step 23. Navigate the mouse cursor to the bottom of this tab and click on a button labeled "New" to create a new trigger for this task.



Step 24. A new window named "Edit Trigger" will appear. At the top of this window is a label "Begin the task" with a drop down menu next to it. Select "At startup" from the drop down menu.



Step 25. At the bottom of the Edit Trigger window double check that a tickable box named Enabled is indeed ticked. You want this to be selected.



Step 26. Click ok to close the Edit Trigger window.



Step 27. Now go back to the top of the Create Task window and now click on the Actions tab.



Step 28. Click on the button at the bottom labeled New to make a new action for this task.



Step 29. A new window labeled "New Action" will pop up. It tells you that you must specify what action this task will perform. Below that you will see a label "Action:" with a drop down menu to the right of it. Make sure "Start a program" is selected.



Step 30. Below the action drop down menu you will see a label "Program/script" with a blank text field and a "Browse" button. Click on browse and navigate to where you stored your WIN TIME.bat file.



Step 31. Select the batch file you made earlier and windows will automatically paste the location of the script in the text field next to browse.



Step 32. Do nothing else on the New Action window and simply click on OK to close the popup.



Step 33. Now we are back in the main window for create task. Click on OK and enter your admin account password.




Step 34. Time to test the batch and the task to run it. Navigate to the taskbar where the current time is displayed in the bottom right corner of your windows desktop. Right click and select Adjust date/time from the context menu.




Step 35. On the right of the "Date & Time" window you will see entries under a title "Related settings". Click on the text "Additional date, time, & regional settings. A new window named "Clock, Language, and Region" will open up.




Step 36. On the main part of the window from step 35, you will see green text labeled "Date and Time" with three options in blue text below it. Click on "Set the time and date".




Step 37. A popup labeled "Date and Time" will popup. Next to the animated icon resembling a wall clock, there is a clickable button with a security shield icon labeled "Change date and time". Click on it. Enter your admin password.




Step 38. On the right, you will again see an animated icon resembling a wall clock. Below it is the current time with up and down arrows. Click on the part where the hour number is displayed and change it something else such as 10, 9, etc. regardless of what time is currently displayed. Click Ok on Date and Time Settings Window to close.




Step 39. On the original Date and Time window, click apply if it isn't greyed out, and then click ok to close that window.




Step 40. Close all other windows and tell the computer to reboot.



Step 41. Select the windows boot manager from the grub menu and get to the welcome screen. The clock may not update there, so logon to your windows account and the clock should update there if you created the task successfully.





Final Note: I realize this may not be an ideal solution, but for me it works and its automated so I don't have to manually force windows to resync the time on the rare occassion I need to use it. I'm also aware you could make a shortcut to the batch file and place it in the startup folder on windows, but I'm not sure that will always work. During my googling one other person couldn't get a batch script to run unless they made a task for it in the scheduler. Still loving Linux MInt more than a year later, and finally had something to contribute back to the community. Thank you and have a great day.
User avatar
Pierre
Level 21
Level 21
Posts: 13215
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: [HOWTO] Dual Booting & Windows System Time Incorrect

Post by Pierre »

You can have the same issue when dual_booting with Windows and OS X as well :o
and the issue can usually be fixed with a Windows Registry Fix:
""To fix it, just hit Start and type regedit.exe in the search box.
Hit Enter and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation.
Right click anywhere in the right pane and hit New > DWORD (32-bit) Value. Name it RealTimeIsUniversal,
then double click on it and give it a value of 1. The next time you reboot from Linux into Windows,
you should notice that your clock actually displays the correct time"".
https://www.howtogeek.com/211144/how-to ... dual-boot/
Yet another way - - is to simply await for 'InternetTimeSync' to correct the issue & which can take a few minutes to work.

you can also correct the issue on the Linux side as well:
https://www.ghacks.net/2017/07/30/fixin ... dowslinux/
does give both methods.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
Mister Cabbage

Re: [HOWTO] Dual Booting & Windows System Time Incorrect

Post by Mister Cabbage »

Thank you Pierre for the other solutions, for some reason I never came across the registry fix in my searches. I'll have to give that a try. I've noticed Windows doesn't seem to lose time if I don't boot all the way into Mint. Have a great day :)
Post Reply

Return to “Tutorials”