First of all, why do you need a shell to execute it? Not a console application - do you open any window?
Secondly, you need to redirect input and output.
And finally, what you need to do is put in the directory in which your script is running permission for the user under your pool control. And remove Admin from your pool.
proc.StartInfo.UseShellExecute = false; proc.StartInfo.CreateNoWindow = false; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.RedirectStandardInput = true; proc.Start(); proc.StandardInput.Flush(); proc.StandardInput.Close(); proc.WaitForExit(); proc.Close();
So, for example, if you add your pool to run under UserA, go to your directory in which your program is running and add permission for UserA so that it can run programs in this directory. If your program also uses other directories for reading and writing, also add permission for UserA for these.
I can’t understand what this process is or doesn’t
You can see if you use Process Explorer on the server and see if it will start, if it is closed, if it is stopped, but stay there.
Aristos
source share