Last active
May 14, 2020 23:40
-
-
Save Soulflare3/f3a89eb9928e4f155b12ce185be630ec to your computer and use it in GitHub Desktop.
Quick & dirty time fix (no checks) for when Windows Update or booting into Linux causes my clock to mess up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sc config W32Time start=auto | |
sc start W32Time | |
sleep 5 | |
w32tm /resync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I simply call this as part of my startup.bat like this:
start "" elevate64 time.bat
And I just have a shortcut to startup.bat in my start menu.
I use elevate64 as a quick way to run as admin. Should work fine as long as it's in the same folder, or if it's available in your Path Variable. There are other ways to run as admin as well, but I use this one for simplicity and the ability to call it anywhere.
You can also set this to run as admin with no additional software. Simply right-click the shortcut in your start menu, go to Properties, then in the General tab hit Advanced. The window that opens should have the option to run the shortcut as admin.
If you go with this method, keep in mind you don't have to put it in an additional file, the file and shortcut would simply be
time.bat
(in this case) and the contents of the file would be the code at the top of the page. Then just set it to run as admin (so you can modify the properties service (AKA turn it off and on again), otherwise Windows won't let you touch it IIRC). You could try it without admin, and if it doesn't work try it with.