471,605 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Process - Invalid

I have the following lines of code:

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "intupld.exe";
process.StartInfo.Arguments = hupFile;
process.StartInfo.WorkingDirectory = hencePath;

The problem I am running into is, if I run the code as listed above, the
Argument does not seem to be passed to the *.exe file, as a command window is
opened and sits waiting for "input."

However: if I run the code as follows (this is how it was ran under old VB6):
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "intupld.exe " + hupFile;
process.StartInfo.WorkingDirectory = hencePath;

I get an error of the file not being found.

How would I be able to call this *.exe file and pass in the file argument?

Thanks
Andy
Feb 20 '06 #1
2 2004
Andy,

The code loks ok to me.
Argument does not seem to be passed to the *.exe file, as a command window
is
opened and sits waiting for "input." I don't quite understand this.

BTW the Process.Start method has a overload that excepts exe and command
arguments. If you don't do anything special you can use it.
--

Stoitcho Goutsev (100)

"Andy" <An**@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...I have the following lines of code:

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "intupld.exe";
process.StartInfo.Arguments = hupFile;
process.StartInfo.WorkingDirectory = hencePath;

The problem I am running into is, if I run the code as listed above, the
Argument does not seem to be passed to the *.exe file, as a command window
is
opened and sits waiting for "input."

However: if I run the code as follows (this is how it was ran under old
VB6):
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "intupld.exe " + hupFile;
process.StartInfo.WorkingDirectory = hencePath;

I get an error of the file not being found.

How would I be able to call this *.exe file and pass in the file argument?

Thanks
Andy

Feb 20 '06 #2
Hi,

The problem I am running into is, if I run the code as listed above, the
Argument does not seem to be passed to the *.exe file, as a command window
is
opened and sits waiting for "input."


I find this difficult to understand, I have more than once execute an
external program with parameters and I have never had any problem.

Also consider using the fullpath to the executable.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Feb 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Richard Myers | last post: by
335 posts views Thread by extrudedaluminiu | last post: by
reply views Thread by CCCYYYY | last post: by

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.