You must Sign In to post a response.
  • Category: Webservices

    Need web service to start the process

    I need the Asp.Net web service to start any process(for example: web service to start the calculator using calc.exe)that need to be run in the windows server 2008...
  • #758498
    In asmx page You can call the Below code...

    string locn = ConfigurationManager.AppSettings["EXELOC"];
    Process myProcess = new Process();

    myProcess.StartInfo.UseShellExecute = false;
    myProcess.StartInfo.FileName = locn + "DoComplexTask.exe";
    myProcess.StartInfo.CreateNoWindow = true;


  • #766062
    Nice post. Sorry to say that I have no idea, but after reading this discussion, I know that web service need to start the process. I hosted my website on,which provides hosting services. Continue discussion so that those who have no idea can get something.

  • #766080
    This is because the process you are executing from web service will not start in the same context/same rights as the client browser, and may not have access like user machine.
    You have to change the Process Model Settings from IIS i.e. change Application Pool identity of your hosted application to "LocalSystem" because it has high-level user rights.
    Just follow these steps:
    Open IIS managerIn IIS Manager==> Click on Application Pool==> Select your Application Pool==> Right click and goto Advanced Settings==> Click on Identity (Bydefault ApplicationPoolIdentity is set)==> Change it to "LocalSystem".
    Please find attached image.

  • #766130
    why you need web service then, just create a windows service and call desired exe. you can call windows service from directly
    use 'ServiceController ' class to call it.
    see below snippet

    public static void StartService(string serviceName, int timeoutMilliseconds)
    ServiceController service = new ServiceController(serviceName);
    TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds);

    service.WaitForStatus(ServiceControllerStatus.Running, timeout);
    // ...

    hope it helps

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • Sign In to post your comments