473,322 Members | 1,232 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,322 software developers and data experts.

Process output redirection?

Hi,

I want to run an application and capture its output. But I receive the
error below in run-time.

"An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll" Additional information: The system cannot find
the file specified


The sub is below.
RunApp("auunitref.exe", "-unit 95xx", "C:\Program Files\DA Manager
CLI")
Public Sub RunApp(ByVal myprocess As String, ByVal param As String,
ByVal workingDir As String)
Dim p As Process = New Process()
Dim psi As New ProcessStartInfo()
psi.FileName = myprocess
psi.WorkingDirectory = workingDir
psi.Arguments = param
psi.UseShellExecute = False
psi.CreateNoWindow = True
psi.RedirectStandardOutput = True
p.StartInfo = psi
p.Start()
Label3.Text = p.StandardOutput.ReadToEnd()
p.WaitForExit()
End Sub

Thanks and regards.

Jan 24 '06 #1
2 1454
> "An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.dll" Additional information: The system cannot find
the file specified


Probably "auunitref.exe" is not found in one of the directories in the PATH
environment variable. Try a fully qualified filespec, or perhaps
CurDir() & "\auunitref.exe"

Jan 24 '06 #2
Hi,

Thanks for your help. Yes the fully qualified path is working now.

RunApp("C:\Program Files\DA Manager CLI\auunitref.exe", "-unit 95xx",
"")

Regards.

Jan 24 '06 #3

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

Similar topics

2
by: uwnewsgroup | last post by:
When I was using Runtime.exec(String cmd) to run a unix utility (join), and try to get its standard output by using Process.getOutputStream(), it blocks forever. I tried it using Java 1.4 and...
1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
3
by: Bill Cohagan | last post by:
I'm writing a console app (in C#) and I want to be able to redirect the standard input/output streams when it's run at a command prompt. IOW I want to support the "<" and ">" redirection syntax....
0
by: craig | last post by:
Appearantly you can't use a redirection command in the Arguments property. You have to: 1. set RedirectStandardOutput to true 2. set UseShellExecute to false 3. start process 4. assign...
3
by: Liren Zhao | last post by:
I use some "Console.WriteLine(some strings here)" to display some debug information in my winform program. How can I get the information in my programe or same them in a text file ?
1
by: Jean Harris | last post by:
If I redirect the console output using the standard method, it works fine if the process outputs all its information and then exits quite soon. But for processes that output information as they are...
2
by: Jacek | last post by:
Hello! My application has to use external native library writing to stdout and stdin. My goal is to redirect output within running process (no chance to do that in child process - Process class...
4
by: Marc Jennings | last post by:
Hi all, I want to run an external app from an assembly. Simple enough... > Process ExtProcess = new Process(); > ExtProcess.StartInfo.FileName = myAppName; > ExtProcess.StartInfo.Arguments =...
3
by: Doru Moisa | last post by:
Hello, How can I capture the output of a long runnning process which I open with popen() ? I tried reading line by line, char by char, but the result always comes when the process finishes. (I...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a C# application in which I start another process which produces output to stdout and stderr. In fact, that process is the uSoft VS2005 C/C++ compiler itself! I would like to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.