I've implemented your solution and I got the credential id from Server>Credentials>Copy Id to clipboard, but it still doesn't seem to be working. Am I missing anything else?
See Code below:
public JobClass CreateCronJob(string server, int interval, DateTime timeTriger, string arguments)
{
JobClass j = new JobClass();
j.Group = server;
j.Name = _mlsArea;
j.Description = GetDropDownValue(arguments);
// create interval trigger for last friday in month
TriggerClass tr = j.AddTrigger(TimeClass.TimeTriggerT.Interval);
tr.TTime.InitDate = timeTriger;
tr.FirstRun = timeTriger;
tr.TTime.IntervalType = TimeClass.IntervalT.Hourly;
tr.TTime.IntervalValue = interval;
tr.Description = String.Format("Every {0} Hours", tr.TTime.IntervalValue);
TaskClass ta = new TaskClass();
ta.StoreSTDOut = true;
ta.StoreSTDErr = true;
ta.Execute = new TaskExecuteClass();
ta.Execute.CmdLine = @"M:\ApplicationCode\ProdEXE\ProdCopy\bin\ProdCopy.exe";
ta.Execute.Arguments = arguments;
ta.ExecutionContext = new ExecutionContextClass();
ta.ExecutionContext.BeforeExecutionLogonCredential = "06c01f20-1a7e-4b82-b481-7c1c30b07ea6";
ta.Name = arguments;
j.Tasks.Add(ta);
return j;