Cannot Create Scheduled Task

An evolving, supported alternative to Rovi
Forum rules
★ Download the latest EPG123 here: https://garyan2.github.io/ <> Setup guide here: https://garyan2.github.io/install.html
User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#21

Post by garyan2 » Sun Dec 22, 2019 6:39 pm

Wherever your \ProgramData folder is (E:\ ?), is there a file \ProgramData\GaRyan2\epg123\epg123Task.xml ?
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#22

Post by garyan2 » Sun Dec 22, 2019 6:54 pm

The error code indicates a permission/access problem. If you want to try manually, from a command prompt do the following:

Code: Select all

C:\Windows\System32\schtasks.exe /create /xml C:\ProgramData\GaRyan2\epg123\epg123Task.xml /tn epg123_update
Of course, replace drives and/or paths to schtasks.exe and epg123Task.xml as needed.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

bbw_atx

Posts: 4
Joined: Tue Dec 31, 2019 7:18 am
Location:

HTPC Specs: Show details

#23

Post by bbw_atx » Tue Dec 31, 2019 7:23 am

I could only get task creation to work by using an install pathname for EPG123 that did not have any spaces in it. Install EPG123 somewhere else other than "C:\Program Files (x86)" where the pathname does not have any spaces.

Hope this works for you.

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#24

Post by garyan2 » Tue Dec 31, 2019 8:00 am

What path did you install to? I'll need to verify, but looks like I may be missing some quotation marks importing the xml file.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

bbw_atx

Posts: 4
Joined: Tue Dec 31, 2019 7:18 am
Location:

HTPC Specs: Show details

#25

Post by bbw_atx » Tue Dec 31, 2019 8:10 am

The default install directory is "C:\Program Files (x86)" and that did not work for me. I switched to "D:\ProgramData" and the install worked. Could be spaces or some pathname length limit? Or it could be something about my system as I have SSD for drive C and the D drive is a disk drive. I added quotes to the XML file, but that did not help. If the EPG123 code uses the value obtained from the XML file it might have stripped the quotes off and some WIndows interfaces don't handle spaces correctly.

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#26

Post by garyan2 » Tue Dec 31, 2019 8:18 am

If you installed in the default folder, then it definitely should have worked. There are no spaces where the task xml file is saved "C:\ProgramData\GaRyan2\epg123\epg123Task.xml". Just to be sure, you used the EPG123 [Create] button to create the task, correct?
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

bbw_atx

Posts: 4
Joined: Tue Dec 31, 2019 7:18 am
Location:

HTPC Specs: Show details

#27

Post by bbw_atx » Tue Dec 31, 2019 8:33 am

My system used the default of "C:\Program Files (x86)". You can see that in the log file lines that OpusthePenguin posted (#20).

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#28

Post by garyan2 » Tue Dec 31, 2019 3:04 pm

Don't know why it didn't work the first time then. I have updated the code and just released v1.3.4 with it. Thanks for letting me know!
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

Space

Posts: 2841
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#29

Post by Space » Tue Dec 31, 2019 4:40 pm

Perhaps your code is looking to see if the program was directly installed in a first-level folder of the "\program files (x86)" folder, whereas this looks to be installed in the "\program files (x86)\video\epg123" folder (unless I'm misreading the log file).

If EPG123 does not think it is installed in the "\program files(x86)\epg123" folder, it will put the output in the same folder as the installed program, which is what it appears to be doing here. I know that you changed the code so that if it was installed there, it would but the data folder in "\ProgramData\GaRyan2\epg123" to avoid issues.

In other words, EPG123 is looking to see if the program is installed in "\program files (x86)\epg123", if it is, put the data in ProgramData, but it is not installed there, it is installed in "\program files (x86)\video\epg123", so it uses the default behavior of just putting it in the output folder of the install directory.

If this is the case, your code should be changed to put the data in ProgramData if the program is installed in ANY subfolder of the "\program files (x86)" folder, rather than just checking if it is in a folder at the first-level of the folder.

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#30

Post by garyan2 » Tue Dec 31, 2019 4:48 pm

Looking at my code, it is set up that way. If the executable path for epg123 is within "Program Files" or "Program Files (x86)", then all the output files should go to the ProgramData folder. I'll try this out on a VM and see if I can duplicate.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#31

Post by garyan2 » Tue Dec 31, 2019 5:39 pm

No issues in the VM when installing to the Program Files (x86)\video\epg123 folder. Below is the relevant code.

Code: Select all

/// <summary>
/// The folder for all user writeable files are based from
/// </summary>
public static string Epg123ProgramDataFolder
{
    get
    {
        if (ExecutablePath.ToLower().Contains(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).ToLower()) ||
            ExecutablePath.ToLower().Contains(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86).ToLower()))
        {
            return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\GaRyan2\\epg123";
        }
        else
        {
            return ExecutablePath;
        }
    }
}
If the executables are within a Program Files folder, then it will write to the ProgramData folder. Otherwise, it will write to the same folder as the executables.

Where this could go wrong and have the effect of what @bbw_atx experienced, is if the environment variables are missing/inaccessible/wrong. Don't know how that could have happened.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

bbw_atx

Posts: 4
Joined: Tue Dec 31, 2019 7:18 am
Location:

HTPC Specs: Show details

#32

Post by bbw_atx » Tue Dec 31, 2019 6:36 pm

Sorry I created this churn without isolating the problem. The script example in the #22 post was failing for me if I ran it with the pathnames for my system. Seems that this is an actual MS problem. See https://support.microsoft.com/en-us/hel ... reate-it-a

Again, sorry for the churn. Happy New Year!

DGennaro

Posts: 5
Joined: Tue Dec 03, 2019 6:21 pm
Location:

HTPC Specs: Show details

#33

Post by DGennaro » Tue Dec 31, 2019 11:50 pm

I've read through all of this and I just cannot get A schedule to work. I've set up Two computers. The first one works perfectly and it schedules perfectly. In fact it's setup programing all the way to January 16th. However, the little rabbit ears TV Icon shows a white X with a red background and I do not know to fix it. The second Computer also works perfectly and has a perfect TV icon but your trick for creating a schedule does not work because the file is already there. Summery: Computer 1: works perfectly but a error TV icon. 2:The second computer also works perfectly and has a perfect TV Icon but will not schedule. The only way I get updates on the second computer is click on save and execute at the bottom of EPG123. That one is also scheduled out to Jan 16th.

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#34

Post by garyan2 » Wed Jan 01, 2020 12:03 am

On the first computer, click the [View Log] button and look for the [ERROR] entries to see what is going on.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

DGennaro

Posts: 5
Joined: Tue Dec 03, 2019 6:21 pm
Location:

HTPC Specs: Show details

#35

Post by DGennaro » Wed Jan 01, 2020 12:24 am

garyan2 wrote: Sat Mar 17, 2018 12:05 am Confusing, but I still think it's a permission problem... or maybe an antivirus program preventing epg123 from writing to the folder?
It says Can't create a file that is already there.

DGennaro

Posts: 5
Joined: Tue Dec 03, 2019 6:21 pm
Location:

HTPC Specs: Show details

#36

Post by DGennaro » Wed Jan 01, 2020 12:25 am

It says Can't create a file that is already there.

DGennaro

Posts: 5
Joined: Tue Dec 03, 2019 6:21 pm
Location:

HTPC Specs: Show details

#37

Post by DGennaro » Wed Jan 01, 2020 12:28 am

It says Can't create a file that is already there.

User avatar
garyan2

Posts: 7480
Joined: Fri Nov 27, 2015 7:23 pm
Location:

HTPC Specs: Show details

#38

Post by garyan2 » Wed Jan 01, 2020 12:42 am

The preferred method of creating a task is to use the [Create] button on the form. The button creates the file. The method I showed above is how the task gets imported into the task scheduler. If you are getting that response, then I believe your task is already created. Please send me your trace.log file to support@garyan2.net.
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io

DGennaro

Posts: 5
Joined: Tue Dec 03, 2019 6:21 pm
Location:

HTPC Specs: Show details

#39

Post by DGennaro » Thu Jan 02, 2020 12:43 am

garyan2 wrote: Wed Jan 01, 2020 12:03 am On the first computer, click the [View Log] button and look for the [ERROR] entries to see what is going on.
On the first computer I went to EPG123 and checked Create XMLTV file then save and Execute and I got the good "TV epg123 Icon"

Jander04

Posts: 2
Joined: Tue Apr 21, 2020 1:48 am
Location:

HTPC Specs: Show details

#40

Post by Jander04 » Tue Apr 21, 2020 1:50 am

Has there been a definitive reason (other than permissions) as to why EPG123 cannot create a daily task to update the guide?

Here is my story:
I installed EPG123 on 2 different computers about 6 months ago. It installed perfectly with only minor problems. My main HTPC had one channel which would not update the EPG.

This was a good channel, and I could not find a way to fix only one channel, so I tried to reinstall. A simple reinstall didn't work, so I did a clean install by wiping out the WMC and EPG123 databases. The channel started working, and everything seemed fine, but EPG123 could not create a daily task. I installed this last time using v1.3.6.

The media center PC EPG has worked (mostly) perfectly for 6 months.

What I have tried:

1. Installed EPG123 1.3.6 several times using a clean install.

2. Installed EPG123 1.3.5 to see if that might fix the problem. Nope.

3. The program is installed into default directories. (C:\ProgramData\GaRyan2\epg123) (C:\Program Files (x86)\epg123)

4. \ProgramData\GaRyan2\epg123\epg123Task.xml gets created.

5. Tried running (as administrator):
C:\Windows\System32\schtasks.exe /create /xml C:\ProgramData\GaRyan2\epg123\epg123Task.xml /tn epg123_update

It fails with ERROR: Cannot create a file when that file already exists. A computer which can create a scheduled task also fails with the same error.


Windows 7 Ultimate

Log:
[4/20/2020 11:56:01 AM] [ INFO] Successfully queried the Task Scheduler for status. No task is scheduled to run.
[4/20/2020 11:56:01 AM] [ERROR] Failed to create a daily update task in Task Scheduler. Exit: 00000001
[4/20/2020 11:56:01 AM] [ INFO] Successfully queried the Task Scheduler for status. No task is scheduled to run.

Any suggestions are appreciated.

Post Reply