Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Pass parameters and execute a console Application from VB.NET?

Pass parameters and execute a console Application from VB.NET?

Scheduled Pinned Locked Moved Visual Basic
questioncsharplinuxhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Freddie Code
    wrote on last edited by
    #1

    Hi, I'm experimenting with VB.NET 2005 Express. I want to write a VB.NET front end to repeatedly call a console application. My question is: How can you pass command line parameters to and execute a console Application from VB.NET? Specifically, how to pass the command line parameters, execute the cosole application and then test to see when it has completed? I found this sample code in the VB.NET help. It calls the console app but I need some help with how to pass command line parameters and test to see if the cosole application is done. ' (2) Call a Visual Basic run-time function (Shell), discard the return value. Call Shell("C:\WINNT\system32\calc.exe", AppWinStyle.NormalFocus) Anyone? Thanks. -- modified at 21:14 Tuesday 24th January, 2006

    D 1 Reply Last reply
    0
    • F Freddie Code

      Hi, I'm experimenting with VB.NET 2005 Express. I want to write a VB.NET front end to repeatedly call a console application. My question is: How can you pass command line parameters to and execute a console Application from VB.NET? Specifically, how to pass the command line parameters, execute the cosole application and then test to see when it has completed? I found this sample code in the VB.NET help. It calls the console app but I need some help with how to pass command line parameters and test to see if the cosole application is done. ' (2) Call a Visual Basic run-time function (Shell), discard the return value. Call Shell("C:\WINNT\system32\calc.exe", AppWinStyle.NormalFocus) Anyone? Thanks. -- modified at 21:14 Tuesday 24th January, 2006

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The Process[^] class has everything you need. Note the events that the class exposes too. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      F 1 Reply Last reply
      0
      • D Dave Kreskowiak

        The Process[^] class has everything you need. Note the events that the class exposes too. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        F Offline
        F Offline
        Freddie Code
        wrote on last edited by
        #3

        Thanks RageInTheMachine953, This works quite nice. How can you test to see when the process is completed?

        D 1 Reply Last reply
        0
        • F Freddie Code

          Thanks RageInTheMachine953, This works quite nice. How can you test to see when the process is completed?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You don't test. The Process class has an Exited event. ALl you do is create the event handler, wire it up with AddHandler, then set EnableRaisingEvents on the Process object that you're using to launch this tool of yours. Then you call .Start on that object. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups