Click in the clock with the right mouse button and select Adjust date/time, then go to the Internet Time tab, hit Change settings and Update now. If it works, we can proceed.
Create a file with the following contents in C:\sync-clock.php
<?php
// Attempt resync
system(‘w32tm /resync /nowait’, $return_var);while( $return_var !== 0 )
{
// Fix w32time errors
system(‘net stop w32time’);
system(‘w32tm /unregister’);
system(‘w32tm /register’);
system(‘net start w32time’);// Sleep to avoid excessive looping
sleep(5);// Attempt resync
system(‘w32tm /resync /nowait’, $return_var);
}// Successful exit
exit(0);
?>
Run Computer Management ( compmgmt.msc ) from Control Panel > System and Security > Administrative Tools.
Go to Task Scheduler Library and Create a Basic Task with When the computer starts as Trigger.
Action will be to Start a Program, Input the path to your php executable (php.exe) in Program/Script.
Add Arguments: -n -f “C:\sync-clock.php”
After task is created, edit its properties:
Change User or Group and type SYSTEM, then confirm
Tick Run with highest privileges
Confirm the changes.







