G
Guest
How can I send the Enter or Return keystroke to a VB.Net 2005 console
application?
application?
How can I send the Enter or Return keystroke to a VB.Net 2005 console
application?
From an external application or the application itself?
VB said: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.StartInfo 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.writeline, but that does not launch the app.
I tried putting a console.writeline(vbcrlf) after the call, but no dice.
Any suggestions greatly appreciated, thanks.
the application.
I have tried the following code without success.
Dim proc As Process = New Process()
With proc.StartInfo
.FileName = "cmd.exe"
.UseShellExecute = False
.WindowStyle = ProcessWindowStyle.Normal
.CreateNoWindow = False
.RedirectStandardInput = True
.RedirectStandardOutput = True
.RedirectStandardError = True
End With
proc.Start()
Dim sIn As StreamWriter = proc.StandardInput
sIn.AutoFlush = True
sIn.WriteLine(Path.Combine(DPAPP_PATH, DPAPP) & " " & procArgs)