Executing a Scheduled task from a Web page

T

tshad

Since I have been having a hard time getting a web page to execute an
executable, is there a way to get the page to executed a Scheduled Task that
is already set up in the schedular?

I already have my program set to run at 10pm at night but want to be able to
execute it manually.

Is there a way to do this from a web page?

Thanks,

Tom
 
P

Patrice

Not sure how it would solve the problem. The executable has to run wether it
is from a scheduled task or not so if it doesn't run from ASP.NET, it is
likely it won't run either when ran from ASP.NET through a scheduled task.

I would investiaget the first problem rather than to find a workaround...
 
P

Patrice

Ok I see the ealier thread. Have you tried the suggestion made by someone to
find out what is exactly the exception you get ?

In most cases this is because the context is different and you made
assumption about this context (in particular the app runs under another
security account and with no UI). For example what happens if you open a
session on the server ?

Also how do you impersonate ? (using
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.username.aspx
?)

The first step would be to start with logging the exception you get to know
exactly what happens. (for example using
http://www.danielmoth.com/Blog/2004/12/appdomainunhandledexception-part-1.html
or just embed your main method call within a try/catch block).
 
T

tshad

Patrice said:
Not sure how it would solve the problem. The executable has to run wether
it is from a scheduled task or not so if it doesn't run from ASP.NET, it
is likely it won't run either when ran from ASP.NET through a scheduled
task.

The task is already in the schedular with enough permissions to run.

All I want to do is tell the scheduler to run it now.

In this case, the scheduler would execute it using the credentials already
assigned to it.

If it runs when the scheduler normally runs it, it should run if you tell
the scheduler to run it now. Just like you can do if you right-click on
it - you can tell it to execute it immediately.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top