Pregunta

I added a simple exe to scheduled tasks through C# site. The site is hosted on IIS7 (the exe just shows a message box). This was the command that I run on the C# code:

schtasks /create /tn mylbat /tr "the exe path" /ru myuser /rp mypassw /sc daily /st 16:03

I can see the task added too. But it doesn't get executed and running schtasks /query /tn mylbat through the command line throws "Could Not Start" as status.

I can see the trigger and action set properly in the task scheduler.

I believe adding the task is working fine since it adds the proper attributes.

Where have I gone wrong?

¿Fue útil?

Solución

I googled a lot about it. The procedures to add a task in the scheduler was perfect but the problem was that that if the service or task that we are trying to schedule needs some interaction, the task wont start. The task has to be one that has no user interaction.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top