Results 1 to 4 of 4

Thread: Process Output

  1. #1

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Exclamation Process Output

    VB Code:
    1. Dim P As Process = New Process
    2.         P.StartInfo.FileName = "CMD.EXE"
    3.         P.StartInfo.Arguments = "/c NETSTAT -N"
    4.         P.StartInfo.CreateNoWindow = true
    5.         P.StartInfo.WindowStyle = ProcessWindowStyle.hidden
    6.         P.StartInfo.RedirectStandardError = True
    7.         P.Start()
    8.         TextBox1.Text = P.StandardOutput.ReadToEnd.ToString

    I did try system.diagnostic.process.start(p), but that did not work.

    I want the Output(ipaddress) to be in a Textbox, not written to a Stream, but as there are no properties like messageoutput, what do I do?
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  2. #2

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Lightbulb Re: Process Output

    Anyone got a Idea, or the Solution?
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Process Output

    In the arguments you can pipe out the results to a textfile. Then read it back in to your program's textbox.
    VB Code:
    1. P.StartInfo.Arguments = "/c NETSTAT -N > C:\Results.txt"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Addicted Member Codehammer's Avatar
    Join Date
    Aug 2004
    Posts
    164

    Re: Process Output

    I Do use the Above, and notes it took up 33K in memory, so thats what I wanted a Direct way. The code I posted was with RedirectStandardError. What about RedirectStandardOutput, it still did not work with the method I put above. But maybe one of ya'll know.....
    Curiosity SKILLED the cat
    Google Talk from your Mobile phone

    Chat from your mobile or get an emulator like J2ME Wireless Toolkit 2.2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width