473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

process execution fails

I'm writing an application that uses system.diagnostics to run an
executable that will allow me to create a map. However the program
fails to start or if its start it is not creating any output. I have a
batch file with the exact same code and it does not work. Can anyone
help? This is the code:

Process p1 = new Process();
p1.StartInfo.FileName = programName2;
p1.StartInfo.Arguments = arg2;
p1.StartInfo.RedirectStandardOutput = true;
p1.StartInfo.UseShellExecute = false;

bool retVal = p1.Start();
//when it gets to this if statement for some reason it
// does not do anything

if (retVal)
{
output2 = p1.StandardOutput.ReadToEnd();
string ouput4 = "worked";
p1.WaitForExit();
}
else { output2 = "did not work";}

//Write psxy process output to file

FileStream fs2 = new FileStream
"c:\inetpub\wwwroot\temp\TEMPO.ps",FileMode.Create ,
FileAccess.Write);

StreamWriter w2 = new StreamWriter(fs2);
// when it writes to the file it does not
// write anything

w2.Write(output2);

w2.Close();

Thanks in advance,
Jorge
Nov 15 '05 #1
0 1330

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
4
by: Prince Kumar | last post by:
I joined a company recently and they have a java program which hangs (does nothing) after a while. This is no way consistent. It could succeed quite a few times and can fail a few other times....
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
1
by: Bill Rapoza | last post by:
We have a method that executes an arbitrary batch file (we use it for remote upgrades of our system). When we execute this method from outside of ASP.NET (either in the foreground app or from a...
3
by: John Kutsor | last post by:
I have been working on a ASP.NET project with VB Code behind for a while now, and it ran perfectly up until now. When I try to set a breakpoint or a watch at certain parts of the project, even...
8
by: =?ISO-8859-15?B?TnXxbw==?= I.G | last post by:
Hello to everybody: I'm trying to get some information about "process management". Let's explain a little... I want to write some code that allows me to execute some "aplications" and collect...
2
by: Anbu | last post by:
Hi all, I'm creating processes of a console based application. After proc.Start() the process is not getting terminated and the thread keeps waiting for some reponse from the process. Now I need...
2
by: Erick | last post by:
I've create a windows service which will start any windows application whose name it finds in an xml file i have pointed it to. However, I also want it to create .net objects from assemblies...
6
by: itsraghz | last post by:
Dear All, I have an issue with destroy() method of java.lang.Process class. All what I am trying to do is, controlling the execution of one program through another. Let's say, Program B has to be...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.