Cannot Create Scheduled Task
Forum rules
★ Download the latest EPG123 here: https://garyan2.github.io/ <> Setup guide here: https://garyan2.github.io/install.html ★
★ Download the latest EPG123 here: https://garyan2.github.io/ <> Setup guide here: https://garyan2.github.io/install.html ★
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
The error code indicates a permission/access problem. If you want to try manually, from a command prompt do the following:
Of course, replace drives and/or paths to schtasks.exe and epg123Task.xml as needed.
Code: Select all
C:\Windows\System32\schtasks.exe /create /xml C:\ProgramData\GaRyan2\epg123\epg123Task.xml /tn epg123_update
- Gary
Keeping WMC alive beyond January 2020. https://garyan2.github.io
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 4
- Joined: Tue Dec 31, 2019 7:18 am
- Location:
- HTPC Specs:
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.
Hope this works for you.
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 4
- Joined: Tue Dec 31, 2019 7:18 am
- Location:
- HTPC Specs:
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.
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 4
- Joined: Tue Dec 31, 2019 7:18 am
- Location:
- HTPC Specs:
My system used the default of "C:\Program Files (x86)". You can see that in the log file lines that OpusthePenguin posted (#20).
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 2841
- Joined: Sun Jun 02, 2013 9:44 pm
- Location:
- HTPC Specs:
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.
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.
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
No issues in the VM when installing to the Program Files (x86)\video\epg123 folder. Below is the relevant code.
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.
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;
}
}
}
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 4
- Joined: Tue Dec 31, 2019 7:18 am
- Location:
- HTPC Specs:
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!
Again, sorry for the churn. Happy New Year!
-
- Posts: 5
- Joined: Tue Dec 03, 2019 6:21 pm
- Location:
- HTPC Specs:
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.
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 5
- Joined: Tue Dec 03, 2019 6:21 pm
- Location:
- HTPC Specs:
-
- Posts: 5
- Joined: Tue Dec 03, 2019 6:21 pm
- Location:
- HTPC Specs:
It says Can't create a file that is already there.
-
- Posts: 5
- Joined: Tue Dec 03, 2019 6:21 pm
- Location:
- HTPC Specs:
It says Can't create a file that is already there.
- garyan2
- Posts: 7480
- Joined: Fri Nov 27, 2015 7:23 pm
- Location:
- HTPC Specs:
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
Keeping WMC alive beyond January 2020. https://garyan2.github.io
-
- Posts: 5
- Joined: Tue Dec 03, 2019 6:21 pm
- Location:
- HTPC Specs:
-
- Posts: 2
- Joined: Tue Apr 21, 2020 1:48 am
- Location:
- HTPC Specs:
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.
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.