Raja Bhushan

Hi !

I have a problem in executing a .net exe from a .net service. Its not executing the .net exe. Also its not throwing any exception in this regard. Can anyone tell me how to solve this or how to execute a .net exe from a .net service..

I have written the following code in "filesystemwatcher". Its executing the "Console.Beep()" exactly as its required to. But its not executing the exe.

Process FTPProcess = new Process();
FTPProcess.StartInfo.UseShellExecute = false;
FTPProcess.StartInfo.FileName = "<Path of the exe file>";
FTPProcess.StartInfo.Arguments = "<input parameters for the exe>";

Re: Visual C# General Not able to run a .net exe from a .net service


Services are not run as a user context, but as a Machine context. I would surmise that the service does not have permissions to run the target executable, either due to directory permissions, or possibly firewall permissions. Change the service to run as an admin to see if that resolves the issue.

Also if the target process is GUI in nature, it will not run, for services are designed to be non GUI and non user operations.