Time Synchronization task fails

Post Reply
cncb

Posts: 217
Joined: Sat Aug 04, 2012 2:31 am
Location:

HTPC Specs: Show details

Time Synchronization task fails

#1

Post by cncb » Wed Apr 09, 2014 4:27 pm

I have noticed that occasionally the system time is a little off on my Windows 8 PCs. It turns out that the "SynchronizeTime" task always fails (0x5) so the time is never synced unless I do it manually. I notice that the "Windows Time" service is not running and is set to "Manual (Trigger Start)". Does anyone else have this problem and know how to fix it? I read online where someone said that this is an "Access Denied" error and that Windows 7 runs this task as "Local Service" user instead of "Network Service" but I tried changing this to "Local Service" and still get the same error.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#2

Post by barnabas1969 » Wed Apr 09, 2014 4:54 pm

Just create a scheduled task that runs once or twice a day. Add two actions to it.

The first action should do this:
%windir%\system32\sc.exe start w32time task_started

The second action should do this:
%windir%\system32\w32tm.exe /resync

You may also want to change your time server in the Control Panel. I use time.nist.gov.

cncb

Posts: 217
Joined: Sat Aug 04, 2012 2:31 am
Location:

HTPC Specs: Show details

#3

Post by cncb » Wed Apr 09, 2014 5:09 pm

Thanks. The existing task had the first action so I added the second action to it and changed it to run as the "Local Service" user and it now completes successfully. The question is why do I have to do this on both my Windows 8.1 PCs? I wonder if WMC somehow messes this up?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#4

Post by barnabas1969 » Wed Apr 09, 2014 6:10 pm

No, it's just that the default implementation isn't very good. I think you really should have added a new task and scheduled it to run daily instead of changing the built-in task. The trigger for the default task won't cause it to run frequently enough to keep your clock accurate enough so that your recordings start on time.

n0mdep

Posts: 5
Joined: Tue Apr 08, 2014 10:01 am
Location:

HTPC Specs: Show details

#5

Post by n0mdep » Wed Apr 09, 2014 8:40 pm

Disable the scheduled events in Windows and use this instead: http://www.timesynctool.com/

It is tiny and it has worked flawlessly for me so far.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#6

Post by barnabas1969 » Wed Apr 09, 2014 10:39 pm

Not sure how installing an application is any easier than adding a scheduled task (which takes zero additional resources until it runs, and then only for a split second). Here... I'll make it uber-easy for you. I've attached a zip file.

1) Download it, unzip it, and open the file "Sync Clock.xml" with your favorite text editor (e.g. Notepad).
2) Press CTRL+H on your keyboard.
3) In the "Find what" box, type "MYPC\MyUsername" (without the quotes).
4) In the "Replace with" box, type the name of your computer, followed by a back-slash, followed by the username you login to your HTPC with. For example, if your PC is named HTPC, and your user is named fubar, type "HTPC\fubar" (without the quotes).
5) Press the "Replace All" button.
6) Save.
7) Open Task Scheduler, and navigate to the "Task Scheduler Library" folder on the left side. You can optionally create a new folder if you want.
8) On the right side, click "Import Task..."
9) Select the file you saved in step 6, and click "Open".

Done.
Attachments
Sync Clock.zip
(1.02 KiB) Downloaded 148 times

cncb

Posts: 217
Joined: Sat Aug 04, 2012 2:31 am
Location:

HTPC Specs: Show details

#7

Post by cncb » Thu Apr 10, 2014 2:23 am

Thanks but just modifying the existing task that already runs daily was easy enough.

User avatar
Crash2009

Posts: 4357
Joined: Thu May 17, 2012 12:38 am
Location: Ann Arbor, Michigan

HTPC Specs: Show details

#8

Post by Crash2009 » Thu Apr 10, 2014 3:35 am

You can lead a horse to water.....

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#9

Post by barnabas1969 » Fri Apr 11, 2014 1:11 pm

cncb wrote:Thanks but just modifying the existing task that already runs daily was easy enough.
I don't think that was a wise decision.

Dkeyguy1

Posts: 163
Joined: Sun Dec 23, 2012 3:38 pm
Location:

HTPC Specs: Show details

#10

Post by Dkeyguy1 » Mon Apr 14, 2014 1:50 pm

We did this for Windows 7......
http://www.pretentiousname.com/timesync/index.html
A similar task for 8 ?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#11

Post by barnabas1969 » Mon Apr 14, 2014 2:35 pm

Dkeyguy1 wrote:We did this for Windows 7......
http://www.pretentiousname.com/timesync/index.html
A similar task for 8 ?
Yes, exactly. This will work in Vista, 7, 8, or 8.1. You can either follow the manual steps in your link, or you can just follow my instructions in post #6 above.

User avatar
newfiend

Posts: 2503
Joined: Tue Jun 07, 2011 12:10 pm
Location: Earth

HTPC Specs: Show details

#12

Post by newfiend » Wed Apr 23, 2014 2:53 pm

Thanks for this thread, been wanting to implement this for awhile and been lazy about getting around to it. This makes it uber easy thanks Barnabas =)

User avatar
newfiend

Posts: 2503
Joined: Tue Jun 07, 2011 12:10 pm
Location: Earth

HTPC Specs: Show details

#13

Post by newfiend » Thu Apr 24, 2014 5:18 pm

Implemented Barnabas's task last night. Went without a hitch. Thanks for the detailed instructions. Now I no longer have to check my clock manually to make sure its accurate. Thank you.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#14

Post by barnabas1969 » Thu Apr 24, 2014 5:28 pm

The only way to make it easier is a self-installer. If I remember and have time, I might do that.

offroad

Posts: 154
Joined: Thu Oct 18, 2012 1:52 pm
Location:

HTPC Specs: Show details

#15

Post by offroad » Sun Apr 27, 2014 10:15 am

Was wondering about this.

User avatar
newfiend

Posts: 2503
Joined: Tue Jun 07, 2011 12:10 pm
Location: Earth

HTPC Specs: Show details

#16

Post by newfiend » Sun Apr 27, 2014 4:17 pm

Yeah a self installer would be great if you get the time. Appreciate you taking the time to help with this. You would think MS would have fixed this small issue a long time ago.

poit57

Posts: 56
Joined: Mon May 05, 2014 7:02 pm
Location:

HTPC Specs: Show details

#17

Post by poit57 » Mon May 05, 2014 7:09 pm

barnabas1969 wrote:
cncb wrote:Thanks but just modifying the existing task that already runs daily was easy enough.
I don't think that was a wise decision.
I tried modifying the built-in time synchronization task to match the parameters at http://www.pretentiousname.com/timesync/index.html. I don't know if I missed a settings or something, but the task failed when I tested it. I reset the task to its default settings and created the new task manually. Now my time syncs once a day with no issues.

It seems like the built-in tyme synch task was modified between Windows 7 and Windows 8, but it still doesn't keep the time updated like it should.

User avatar
newfiend

Posts: 2503
Joined: Tue Jun 07, 2011 12:10 pm
Location: Earth

HTPC Specs: Show details

#18

Post by newfiend » Tue May 13, 2014 9:23 pm

I used Barnabas's instructions above and added the task to task scheduler. It runs daily and my recordings all start on time now where before some would start later than they were supposed to. This worked extremely well and was easy to implement. Just my 2 cents.. I'm in agreement that modifying the built in time sync task probably isn't the best idea.
newfiend

Post Reply