Is there a "portable" way across recent (this millennium) versions of Windows for forcing an NTP synchronisation?

On Windows 7, there are even prerequisites - the service Windows Time needs to be running.

(Click the time in the taskbar → Change date and time settings... → select tab Internet timeChange settings → tick Synchronize... checkbox. This will start the Windows Time service).

After that, from an elevated command prompt, I can do:

> w32tm /resync
Sending resync command to local computer
The command completed successfully.


... but I don't think that's backward compatible. The documented way for Windows XP uses net time:

> net time /setsntp

...but on Windows 7 this gives the error message:

The /QUERYSNTP and /SETSNTP options have been deprecated. Please use w32tm.exe
to configure the Windows Time Service.

So, is there a way to make this happen regardless of Windows version? (If it can't be done in a simple command, then maybe programmatically?)


You should be able to use w32tm on all the Windows versions from Windows 2000 and on.

I tried running

w32tm /resync

on Windows XP and 2003, and the command works on them with no problem.

You can see here it is supported on Windows XP.

Also you can see it is supported in Windows 2000, look here.

  • It's good to hear that :) – Cristi Diaconescu Feb 8 '13 at 13:42
  • 1
    w32tm /resync says "The computer did not resync because the required time change was too big." as my CMOS battery is dead and my computer clock resets on every boot at 1/1/2000 12:00 AM. Any help? – Never Quit Nov 4 '15 at 16:47
  • 1
    Found solution as per blog.bruteforcetech.com/archives/911 , do not forget to restart W32Time service net stop W32Time then retry w32tm /resync – Never Quit Nov 4 '15 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.