Killing the process running on server

971 Views Asked by At

I wrote a program. It kills the process notepad.exe running on computer by and it looks like that: `

Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.WorkingDirectory = @"d:\Windows\System32";
process.StartInfo.Arguments = "/c taskkill /IM notepad.exe";
process.Start();
process.Close();`

I placed this code on my web page. The problem is: when I use the Visual Studio Development server it works. When change to local iis 7.5 it don't. I tried to figure it out, so I even gave the administrator privileges to "DefaultAppPool" or run the whole web page as Administrator (then all the processes as cmd.exe are running as Administrator) but wasn't a solution.

0

There are 0 best solutions below