Process.StandardInput.WriteLine not working under Vista?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?U3VydHVyWg==?=

    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 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
  • rowe_newsgroups

    #2
    Re: Process.Standar dInput.WriteLin e not working under Vista?

    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]

    Comment

    Working...