473,800 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process.Standar dInput.WriteLin e 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 psiProcessStart Info As New ProcessStartInf o
With psiProcessStart Info
.Arguments = "" 'command line arguments
.CreateNoWindow = False
.ErrorDialog = False
.FileName = "notepad.ex e"
.LoadUserProfil e = False
.RedirectStanda rdError = False
.RedirectStanda rdInput = True
.RedirectStanda rdOutput = False
.UseShellExecut e = False 'this must be false for
input/output/error redirection
.WorkingDirecto ry = ""
End With
Using prc As Process = Process.Start(p siProcessStartI nfo)
MsgBox("")
prc.StandardInp ut.WriteLine("T his line added by ProcessMgmtDemo ")
prc.StandardInp ut.WriteLine("T his line added by ProcessMgmtDemo ")
prc.StandardInp ut.WriteLine("T his line added by ProcessMgmtDemo ")
End Using

--
David Streeter
Synchrotech Software
Sydney Australia
Oct 23 '08 #1
1 4244
On Oct 22, 8:32*pm, SurturZ <surt...@newsgr oup.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 psiProcessStart Info As New ProcessStartInf o
* * * * With psiProcessStart Info
* * * * * * .Arguments = "" 'command line arguments
* * * * * * .CreateNoWindow = False
* * * * * * .ErrorDialog = False
* * * * * * .FileName = "notepad.ex e"
* * * * * * .LoadUserProfil e = False
* * * * * * .RedirectStanda rdError = False
* * * * * * .RedirectStanda rdInput = True
* * * * * * .RedirectStanda rdOutput = False
* * * * * * .UseShellExecut e = False 'this must be false for
input/output/error redirection
* * * * * * .WorkingDirecto ry = ""
* * * * End With
* * * * Using prc As Process = Process.Start(p siProcessStartI nfo)
* * * * * * MsgBox("")
* * * * * * prc.StandardInp ut.WriteLine("T his line added by ProcessMgmtDemo ")
* * * * * * prc.StandardInp ut.WriteLine("T his line added by ProcessMgmtDemo ")
* * * * * * prc.StandardInp ut.WriteLine("T his 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
3675
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 I cant make it work, it always stalls when I try to read the output: /// code 1 Process ftpProcess = new Process();
4
5950
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(); p10.StartInfo.FileName = "cmd.exe"; p10.StartInfo.UseShellExecute = false; // p.StartInfo.CreateNoWindow = true; p10.StartInfo.RedirectStandardInput = true;
1
1897
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 decrypt. 2) Once GPG.exe begins, it prompts for the passphrase associated with the key. So in my C# code, I've created a process, configured the StartInfo for the process to allow StandardInRedirect, started the process, and tried
0
4211
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, if I'm using RUNAS (e.g. in order to move files to a protected network share), I run into the problem that RUNAS requires a two-step process to get it started. If you're calling RUNAS from the command prompt, after entering the command line text...
1
5995
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 am executing the find.exe program. The application works perfectly in the development environment. As soon as I execute the compiled program and start the find process I get an "Application Error". The error states that the instruction...
2
8634
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 and this seems an ideal solution. I'm running it as a process and re-directing the standardinput/output/error However, despite working through all the different variations of code I can either think of or find I am unable to achieve true...
5
3458
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 "notes" not being the issue). Beginning with... Dim objProcess As Process Dim objProcessStartInfo As New ProcessStartInfo
11
11964
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 example, does not seem to process any I/O through the Process object. I know that in the case of PowerShell there are better ways to "wrap" the console by directly interfacing with the assemblies of System.Management.Automation or some similarly...
14
10856
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 application need the input. 'myprog.pl' is the simple perlscript which ask for the your name and print the same. the execution sequence is given below: c:\ myprog.pl Enter your name: Myname Your name is: Myname
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.