Apologies if the question was not clear, I know it sounds simplistic but...
I have tried launching another program from the console app using Process
and Process.StartIn fo but the called app does not always work as expected
with the arguments passed in. When the arguments are run through a command
prompt it always behaves as expected.
I tried entering the call to the application with arguments using
console.writeli ne, but that does not launch the app.
I tried putting a console.writeli ne(vbcrlf) after the call, but no dice.
Any suggestions greatly appreciated, thanks.
--
Coding in Sunny Central Florida
"rowe_newsgroup s" wrote:
On May 9, 8:34 am, VB Jonnie <VBJon...@discu ssions.microsof t.com>
wrote:
How can I send the Enter or Return keystroke to a VB.Net 2005 console
application?
--
Coding in Sunny Central Florida
>
Question 1:
>
From an external application or the application itself?
Apologies if the question was not clear, I know it sounds simplistic but...
>
I have tried launching another program from the console app using Process
and Process.StartIn fo but the called app does not always work as expected
with the arguments passed in. When the arguments are run through a command
prompt it always behaves as expected.
>
I tried entering the call to the application with arguments using
console.writeli ne, but that does not launch the app.
>
I tried putting a console.writeli ne(vbcrlf) after the call, but no dice.
>
Any suggestions greatly appreciated, thanks.
>
>
Use the StandardInput property of the Process object to send input into
the application.
Use the StandardInput property of the Process object to send input into
the application.
I have tried the following code without success.
Dim proc As Process = New Process()
With proc.StartInfo
.FileName = "cmd.exe"
.UseShellExecut e = False
.WindowStyle = ProcessWindowSt yle.Normal
.CreateNoWindow = False
.RedirectStanda rdInput = True
.RedirectStanda rdOutput = True
.RedirectStanda rdError = True
End With
proc.Start()
Dim sIn As StreamWriter = proc.StandardIn put
sIn.AutoFlush = True
Apologies if the question was not clear, I know it sounds simplistic but...
I have tried launching another program from the console app using Process
and Process.StartIn fo but the called app does not always work as expected
with the arguments passed in. When the arguments are run through a command
prompt it always behaves as expected.
I tried entering the call to the application with arguments using
console.writeli ne, but that does not launch the app.
I tried putting a console.writeli ne(vbcrlf) after the call, but no dice.
Any suggestions greatly appreciated, thanks.
>
Use the StandardInput property of the Process object to send input into
the application.
>
--
Göran Andersson
_____
On May 9, 9:50 am, VB Jonnie <VBJon...@discu ssions.microsof t.com>
wrote:
Use the StandardInput property of the Process object to send input into
the application.
>
I have tried the following code without success.
>
Dim proc As Process = New Process()
With proc.StartInfo
.FileName = "cmd.exe"
.UseShellExecut e = False
.WindowStyle = ProcessWindowSt yle.Normal
.CreateNoWindow = False
.RedirectStanda rdInput = True
.RedirectStanda rdOutput = True
.RedirectStanda rdError = True
End With
proc.Start()
Dim sIn As StreamWriter = proc.StandardIn put
sIn.AutoFlush = True
>
sIn.WriteLine(P ath.Combine(DPA PP_PATH, DPAPP) & " " & procArgs)
You need to create a StreamWriter and associate it with the sub-
processes standard input. Then, anything you write to the StreamWriter
will be sent to the subprocesses standard input stream.
>
--
Coding in Sunny Central Florida
>
>
>
"Göran Andersson" wrote:
VB Jonnie wrote:
Apologies if the question was not clear, I know it sounds simplistic but...
>
I have tried launching another program from the console app using Process
and Process.StartIn fo but the called app does not always work as expected
with the arguments passed in. When the arguments are run through a command
prompt it always behaves as expected.
>
I tried entering the call to the application with arguments using
console.writeli ne, but that does not launch the app.
>
I tried putting a console.writeli ne(vbcrlf) after the call, but no dice.
>
Any suggestions greatly appreciated, thanks.
>
Use the StandardInput property of the Process object to send input into
the application.
Comment