Problem with System.Diagnostics.Process in ASP .NET

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.
 
A

Alvin Bruney

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
 
K

Kelly Leahy

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
 
R

Ron Fidel

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
 
R

Ronen Fidel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top