Alon M
Alon M

Reputation: 1683

ASP.NET|Process Class- Runing And Stoping Process

few days ago, my freind asked me to build him a proagram that start and stop process.

so, as easy as it is. i did the next code:

(using System.Diagnostics)

Process process;
process = Process.start("SOMEONE.exe");
Process.Kill();

Now, thats it the easy part. everything works. but. when i do the same code in asp.net, its strat the process, but when you kill the process, nothing happnd. no matter what i did, any one have any solion to the next problem :(?

Upvotes: 0

Views: 486

Answers (2)

Leon
Leon

Reputation: 3401

AppPool in IIS needs to run under LOCAL Account - otherwise ASP.NET doesn't have enough rights to start/stop processes on the server.

Upvotes: 0

Ofer Zelig
Ofer Zelig

Reputation: 17508

From MSDN:

The Kill method executes asynchronously. After calling the Kill method, call the WaitForExit method to wait for the process to exit, or check the HasExited property to determine if the process has exited.

Upvotes: 2

Related Questions