S
SurturZ
The following code used to work. It starts up notepad and types a few lines.
What am I doing wrong? I'm using VB.NET 2005 under Vista. It starts notepad
okay, but it can't 'type' into it.
'demonstrate "typing" into notepad
Dim psiProcessStartInfo As New ProcessStartInfo
With psiProcessStartInfo
.Arguments = "" 'command line arguments
.CreateNoWindow = False
.ErrorDialog = False
.FileName = "notepad.exe"
.LoadUserProfile = False
.RedirectStandardError = False
.RedirectStandardInput = True
.RedirectStandardOutput = False
.UseShellExecute = False 'this must be false for
input/output/error redirection
.WorkingDirectory = ""
End With
Using prc As Process = Process.Start(psiProcessStartInfo)
MsgBox("")
prc.StandardInput.WriteLine("This line added by ProcessMgmtDemo")
prc.StandardInput.WriteLine("This line added by ProcessMgmtDemo")
prc.StandardInput.WriteLine("This line added by ProcessMgmtDemo")
End Using
What am I doing wrong? I'm using VB.NET 2005 under Vista. It starts notepad
okay, but it can't 'type' into it.
'demonstrate "typing" into notepad
Dim psiProcessStartInfo As New ProcessStartInfo
With psiProcessStartInfo
.Arguments = "" 'command line arguments
.CreateNoWindow = False
.ErrorDialog = False
.FileName = "notepad.exe"
.LoadUserProfile = False
.RedirectStandardError = False
.RedirectStandardInput = True
.RedirectStandardOutput = False
.UseShellExecute = False 'this must be false for
input/output/error redirection
.WorkingDirectory = ""
End With
Using prc As Process = Process.Start(psiProcessStartInfo)
MsgBox("")
prc.StandardInput.WriteLine("This line added by ProcessMgmtDemo")
prc.StandardInput.WriteLine("This line added by ProcessMgmtDemo")
prc.StandardInput.WriteLine("This line added by ProcessMgmtDemo")
End Using