I have a console app which calls a command line program:
var commandArgs = String.Format(@"/C """"{0}"" /user:""{1}"" /password:""{2}"" /report:""{3}"" /paramfile:params.xml /Quiet """" ", PathToExe, Username, Password, name);
The app runs perfectly when I run it from the command prompt.
However, if I run the console app from Task Scheduler, it fails everytime when trying to call the command line.
If I put the same code into a Windows Service, it also fails in the same way.
Is there a permissions issue when running in Task Scheduler. Can anyone shed any light on why this is happening.
I have tried using absolute paths and relative paths. I have tried to change the quotation marks around the command argument: see http://www.mobzystems.com/code/bugingetcommandlineargs/ but nothing works in the Task Scheduler, but works like clockwork without fail when run directly from the command line.