Problem with System.Diagnostics.Process in ASP .NET

  • Thread starter Thread starter Ron Fidel
  • Start date Start date
R

Ron Fidel

Hi,

I'm not able to run external applications from ASP .NET
(C#) with the Process class. The program appears in the
Windows Task Manager but doesn't run.
 
if it is in the task manager that implies it is running. how are you firing
the external app?
here is a complete example, pay attention to the hidden attribute

ProcessStartInfo psi = new ProcessStartInfo("notepad.exe");
psi.WindowStyle = ProcessWindowStyle.Hidden;

Process p = new Process();
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(MyExited);
p.StartInfo = psi;
p.Start();

..... do stuff ...

p.Kill(); // Try killing the process
 
My guess is that your external application is running under a different user
(and thus in the non-interactive desktop).

Try setting your ASP.NET process to the user account of a user and logging
in to the server as that user.

kelly
 
I'm trying to run a command script (.cmd) with arguments,
the same way I run it from the command line. The ASP .NET
code is running without errors but nothing is happaning.
My code is:
process1.StartInfo.FileName = DirPath + "\\makelist.cmd";
process1.StartInfo.Arguments = StreamName;
process1.Start();

I also tried with adding
process1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process1.StartInfo.UseShellExecute = true;
but it doesn't help.

BTW
I'm trying to convert a VB6 code that did the job with
Shell (DirPath & "\makeList.cmd " & StreamName)

Thanks,
Ron Fidel
Unisfair
 
I'm trying to run a command script (.cmd) with arguments, the same way I
run it from the command line. The ASP .NET code is running without
errors but nothing is happaning.
My code is:
process1.StartInfo.FileName = DirPath + "\\makelist.cmd";
process1.StartInfo.Arguments = StreamName;
process1.Start();

I also tried with adding
process1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process1.StartInfo.UseShellExecute = true;
but it doesn't help.

BTW
I'm trying to convert a VB6 code that did the job with
Shell (DirPath & "\makeList.cmd " & StreamName)

Thanks,
Ron Fidel
Unisfair
 
Back
Top