net time & w32tm problem

Posted on 2004-04-30
Last Modified: 2012-06-21
I have a client/server application in .NET in which communication between the two is time sensitive and requires both machines to be sync'd.

XP dos, and the version of dos on win2k are different.  So some of the commands are different.  

IE:  winxp is w32tm /resync
      win2k is w32tm -s

These are the steps I think I need to do:
1)  set sntp server. This currently works on both machines like this
        net time /setsntp:<machineName>

2) update the time, and if possible set interval at which it will check to make sure the time is in sync.

win2k - currently doing:
           net time stop w32time
           w32tm -s (or -once?) -period 65532 (to sync ever 8 hours)
           net time start w32time

now this works...the first time when I use -once, but not -s.
Both -s and -once will sync the time after the service is started (unless the -s attempt just failed and is using previous settings from my -once attempt).

However,  i set the period to 1440 (to sync every minute) and it doesn't sync every minute.  I've set the time ahead and back (knowing that it handles those 2 scenarios differently... i think if its back it slowly syncs and if its ahead it'll do it immediately).

and with winXP  this command works :
          net time /set /y

however that command does not work on win2k? ? ? ?   i get "System error 5 has occured"

I have done research on this system error 5 and can't seem to figure out what the problem is.
Anyways.. seems like there are a lot of examples on the web.. so please.. DON'T POST LINKS!!  lol.  

I'll save you the trouble to what I've seen and what I've tried....
Question by:bswiftly
  • 9
  • 7

Accepted Solution

TMWSIY earned 50 total points
ID: 10960585

are you supplying a server to sync with in the cmd?


net time \\someServer /set /yes


Author Comment

ID: 10960832
you mean when I try it in win2k?  

If I supply the computer name as you suggest, I get the System error 5 message as well.

Although as I understand it, after I have set the sntp server, I can just run w32tm -s  and it'll sync to that server.  

i'm assuming that:

net time /set

command just calls the w32tm function? am I right?


Expert Comment

ID: 10961159
Sorry I cant be of more help here but I'm still on an NT domain :(

With nt I supply a server name the the cmd sync the time with that server, reguardless of sntp.

Try the cmd from the cmd line and see if it works.  Just use the server name of your sntp server.

I have to disable the w32tm service in XP clients becuase NT domains, and workstations, do not support it.  However I'm not sure about 2k machines.

In xp you can use the /setsntp to set up your clients to sync with your sntp server.

/SETSNTP[:ntp server list]
                Sets the NTP time servers to be used by this computer.  This
                may be a list of IP addresses or DNS names separated by spaces.
                If multiple timeservers are listed, the list must be surrounded
                by quotes.


Expert Comment

ID: 10961174
net help time

for full details...

Might want to run this from the cmd line on an 2k workstaion to see its capabilities.

Expert Comment

ID: 10961203

Sorry missed this:
>>Although as I understand it, after I have set the sntp server, I can just run w32tm -s  and it'll sync to that server.

if it still does not work try syncing with this cmd as a workaround:

net time \\sntp /set /yes

where sntp is the computer name of your sntp server.

Author Comment

ID: 10961226
that /setsntp command you mentioned was in my original post.  

and yes i've been through the net time ?  list of options and they are different i had mentioned win2k's equivalency of xp's w32tm /resync  is w32tm -s.  net time options are different as well but on win2k i've been using the win2k list and i still get that error.

Thanks for the input though.

I'm wondering why I can't find a lot of helpful documentation with M$

Expert Comment

ID: 10961539
Did you see these?

120944 - Using NET TIME for all Workstations and Servers;EN-US;q120944

How to Configure an Authoritative Time Server in Windows 2000

and for the time service docs:

R U running a 2k domain?


Author Comment

ID: 10961581
Pretty sure its a 2k domain.  

Haven't seen those links but if you look at the links I posted...there is more information than in the ones at the microsoft site that you posted there..  i'm confused as to why this is happening.
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)


Expert Comment

ID: 10961617

I use this cmd in my startup script on my NT domain:

net time \\mailsvr /set /yes

so each computer on the network gets it time sync'ed with my mail server at every logon.

When user log on their 2000 workstaions it does sync the time.  Some thing to consider if you have control over the domain or access to the admin :)

Good Luck,

Author Comment

ID: 10961656
well the way I have it working right now is as above, it checks the OS, and then runs a batch file to set up the time server.  

As posted initially, I have it working on both OS's when the service starts (ie on boot up).   But the w32tm -period  parameter doesn't seem to fire.  I set the interval to 1 minute and 3,4,5 minutes go by without updating the time...  I guess this was my main question.   Is my syntax wrong for the -period command.?


Expert Comment

ID: 10961889
not sure...

fire up regedit and look here:


and check the period key.

Used to control how often the time service synchronizes. If a value is given, it must be one of the
special values listed below.

     65531, "DailySpecialSkew" = once every 45 minutes until successful one time, then once every day
     65532, "SpecialSkew" = once every 45 minutes until successful three times, then once every eight hours (three times per day) [default]
     65533, "Weekly" = once every week (seven days)
     65534, "Tridaily" = once every three days
     65535, "BiDaily" = once every two days
     0 = once per day
     freq = freq times per day. If you choose to add a value other than any of those specified above, you must use this option.

Dont modify these settings just check to see if it is set.

Expert Comment

ID: 10962000
If you look at the documentation the -s switch forces the computer (or the local computer if none is specified) to resynchronize, then *exits*.

Also found this at the end of the win32time docs:

I know my computer's time is incorrect. Why hasn't it synchronized yet?
A clock on a computer does not adjust itself immediately. A computer synchronizes with the time server at system startup and then every 45 minutes until it has successfully synchronized three times. When the clocks are correctly synchronized, they sync again after eight hours, and every eight hours after that. (For a description of how to manually change this setting, see "W32Time Registry Entries" earlier in this article.)

and this is true for the time you have selected:

 65532, "SpecialSkew" = once every 45 minutes until successful three times, then once every eight hours (three times per day) [default]


Author Comment

ID: 10962051
ah.. i haven't read that freq. thing before... maybe just missed it..  i thought i could just say -period 1440 for every minute.  

so do i go w32tm -s -period freq 1440 ?   or whats the syntax there then ?

just w32tm -s -freq 1440?

I'll test and let you know if you don't first

Expert Comment

ID: 10962146
You can only use these numbers:

0 = once per day
65535 = once every two days
65534 = once every three days
65533 = once every week (seven days)
65532 = once every 45 minutes until you get three good syncs, then once every eight hours (three/day)
65531 = once every 45 minutes until you get one good sync, then once every day

If you use anything else it is times/day.  so 1440 would be once a minute.  I think freq is just the number you pass to it.  try running the cmd with the -v switch so you can see whats going on.

w32tm -s -period 1440 -v


Author Comment

ID: 10962763
you have to put in freq.  

if you use one of the numbers listed, you don't have to...

w32tm -s -period 65532     //no freq needed

w32tm -s -period freq 1440  //have to list freq if you are going to use a custom #.  that works.


Author Comment

ID: 11008525
thanks for your help.. i sort of worked around it myself but i'll give you the points for the effort.

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cannot access port 443 4 575
Why Windows 7 desktop can not connect to Windows 2000 terminal server? 3 1,364
Question about teaming two NIC's on Server 2012 2 569
VSS on host & VM 10 400
In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now