Starting Windows Service from ASP.NET

E

Evgeny Cherny

Hi,

I need to start some Windows Service from ASP.NET.
I use Process class of Framework.

/***************************************************/
System.Diagnostics.Process p=new System.Diagnostics.Process();
p.StartInfo.FileName="NET"; // Run NET command
p.StartInfo.Arguments="START MyService"; //Parameters
p.StartInfo.UseShellExecute=false;
p.StartInfo.RedirectStandardError=true;
p.Start();
string errstream=p.StandardError.ReadToEnd(); // Catch the output of process
p.WaitForExit();
/***************************************************/

After running this code errstream contains:
System error 5 occured
Access denied.

This behavior I get only when I try to start service - other NET commands
like HELP for example executed correctly.

I granted permission of administrator to ASPNET account, but It did't help.

What is a problem?
 

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