Decoding the schedule.
Media Center stores the last time the download ran and the next time it will run in the registry.The 2 entries in the registry that contain these values are respectively:\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Service\EPG\dlLastTime\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\Service\EPG\dlRegTime
The values that are stored in the registry are the number of 100ns intervals that have elapsed since January 1, 1601. Since these values are manipulated in registers by the program using load and store commands, they are stored in the registry backwards.
In order to determine what actual local time values the entries represent I find it easiest to use the Windows time program, W32tm. This program is already on every Windows XP system, and will convert NT Time Epoch (NTTE) decimal values to GMT and local time. The format for this command is: w32tm /ntte <time value in decimal>. Of course the values are stored in hexadecimal so we need to use the calculator in accessories. Bring up the calculator, select scientific mode, hexadecimal, and enter the value from the registry backwards in 1 byte increments. The following are examples based on my system.
Example 1.The value is dllasttime is a6 4f 6c b6 70 dd c4 01, so enter 1c4dd70b66c4fa6 into the calculator. Click decimal and you will get 127470165639843750. At the command prompt run w32tm /ntte 127470165639843750 and you will get:
C:\Documents and Settings\UserName>w32tm /ntte 127470165639843147534 21:56:03.9843750 - 12/8/2004 14:56:03 (local time)
So the last time the guide downloaded was 14:56:03 local time, which equates to 21:56:03 GMT, a 7 hour difference in my area (MST). Neat huh? Keep reading...
Example 2.Following the above procedure but using dlregtime I take the value from the registry which in my case is 2d 85 2c 34 ff dd c4 01, I enter 1C4DDFF342C852D into the calculator, click decimal and get 127470777634948397. At the command prompt I run w32tm /ntte 127470777634948397 and get:
C:\Documents and Settings\UserName>w32tm /ntte 127470777634948397147535 14:56:03.4948397 - 12/9/2004 07:56:03 (local time)
Wait a minute! It should say 14:56:03 local time, but it says 14:56:03 GMT. That's not right. If I go into the event viewer and look in the Application log for the entry "Media Center Scheduler" I see:
The next scheduled download of the latest television listings guide (EPG) is 12/9/2004 14:56:3.
That's the GMT time indicated in example 2, but now it shows as the local time the next download is scheduled. Is this some Microsoft trick to distribute the download times more evenly. You would think that the time zones themselves would take care of that. In any event, I want my computer to come out of standby at 16:00 hours (4 PM MST) and it is now scheduled for 14:56:03. I need to add 1 hour, 3 minutes and 57 seconds, or 3,837 seconds. In NTTE values that's 38370000000. So I add 38370000000 to 127470777634948397 and get 127470816004948397. Run w32tm and get:
C:\Documents and Settings\UserName>w32tm /ntte 127470816004948397147535 16:00:00.4948397 - 12/9/2004 09:00:00 (local time)
Darn, I have 4948397 extra 100ns units or .49 seconds extra. GOT to get rid of that so I subtract 4948397 from 127470816004948397 and get 127470816000000000. Now when I run w32tm I get:
C:\Documents and Settings\UserName>w32tm /ntte 127470816000000000147535 16:00:00.0000000 - 12/9/2004 09:00:00 (local time)
Whew!! That's better. Now lets convert that to hex, 1C4DE0822E8C000, enter that into the registry key dlregtime as 00 C0 E8 22 08 DE C4 01. Done. Now lets reboot the computer and see what it says in the event log about the next scheduled download time.
The next scheduled download of the latest television listings guide (EPG) is 12/9/2004 16:0:0.
Now all I have to do is wait to see if this works.
Holy Mackerel! That's a truly brilliant piece of detective work, Cowboy. The issue of EPG download time has come up repeatedly but has never before been answered satisfactorily. Many, many thanks for figuring this out!
Petros
Well I'll be!!! At 4:00 PM MST my computer woke up and downloaded the EPG. So it actually works!!
Hi Cowboy -
Just wanted to say thank you for this detailed work. I used your info to re-program my EPG to download at 1:30am daily. It works like the proverbial charm. Great analysis and clear write-up.
Regards,- Supra-TT
Hi Cowboy,
Also many thanks from me for your excellent and thorough investigation. I have written a small tool around this which will hopefully assist others. See a small description below. Thanks again!
riesm.
To check the change (after you have restarted the computer), you can start up the event viewer (Click Start / Run... and enter "eventvwr" and click OK). In the Application Log you will find an entry from the "Media Center Scheduler", double-clicking that entry will show you the time the next download will occur:
The media center scheduler is an active process and will only read the new download time from the registry when it starts up. The easiest way to do so, is by restarting the system. The other way (expert users only) is to kill the "ehSched.exe" process and start Media Center (starting MCE will restart ehSched.exe as well).
Many thanks go to Cowboy for his excellent article on guide download time published at the greenbutton website at http://www.thegreenbutton.com/community/shwmessage.aspx?forumid=42&messageid=80831. I have written this small tool to accommodate people who don't want to mess with the registry.
riesm:Hi Cowboy,Also many thanks from me for your excellent and thorough investigation. I have written a small tool around this which will hopefully assist others
Also many thanks from me for your excellent and thorough investigation. I have written a small tool around this which will hopefully assist others
Hi Gents,
I was able to change the time of download but I wont download for a reason I don't know... Please help!
I would need your help to resolve my little issue. I have scheduled an automatic guide download at 4:00 AM. When comes the time to download, the machine wakes-up up from it sleep state but don't download. I can see in the event viewer that their some activities at 4:00 for about 40 secconds and then standby again.
I tought it was a weak signal from my WIFI card but I remove it and hard wired from my router to my onboard LAN. It didn't made any difference.
I can download the guide manually no problem. I can access the internet no problem
Please help!
System
Athlon 3200+
1 Gig Ram
MSI K8NGM2-FID
250 Gig HDD
MCE 2005 Service pack 2 updated to the bone!
No antivirus, no 3th party firewall
Thank you
Charles