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

Process.StandardInput.WriteLine not working under Vista?

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

--
David Streeter
Synchrotech Software
Sydney Australia
Oct 23 '08 #1
1 4203
On Oct 22, 8:32*pm, SurturZ <surt...@newsgroup.nospamwrote:
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

--
David Streeter
Synchrotech Software
Sydney Australia
Why are you trying to open and manipulate Notepad instead of just
writing to a file and then opening it in Notepad?

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Oct 23 '08 #2

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

Similar topics

5
by: ask | last post by:
Hi NG I'm a bit new to programming c# and have a question regarding ftp by the command prompt. As far as I can see it should be possible to start a process and pipe command streams into it. But...
4
by: jam | last post by:
Dear All, I have a command process running xcopy in console, and now I want to execute the program Rsync After the files are copied...how could i do?? Process p10=new Process();...
1
by: Bill Gregg | last post by:
I'm trying to decrypt a file using GPG and starting it via a system.diagnostics.process. The required steps are: 1) Launch the GPG.exe with the correct parameters indicating what file to...
0
by: Phillip Galey | last post by:
I'm trying to use the Process object to have RUNAS run DOS commands. I have no problem getting the Process object to run DOS commands and return the resulting text back to the program. However,...
1
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: Al | last post by:
I'm currently attempting to use PLink (the console component of PUTTY - see http://www.chiark.greenend.org.uk/~sgtatham/putty/) as a Telnet component as I may in future need to change to using SSH...
5
by: =?Utf-8?B?Z215ZXJz?= | last post by:
Hello, I am attempting to start a cmd.exe process and pass several .vbs scripts (with additional parameters) and then read the output from the scripts and make "notes" in a DataTable (the...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
14
by: masaniparesh | last post by:
Hi Friends, The basic issue is "To read stdin and stdout in the same program" The following program is i have wrote using thread but i figured out that stdout is working but it is not working when...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.