Running a command line process

Discussion in 'Microsoft VB .NET' started by Guest, Jun 10, 2004.

  1. Guest

    Guest Guest

    Hi I want my VB.NET application to run a command from the command line and then wait for the command to finish before continuing.

    I am currently using

    System.Diagnostics.Process.Start(strApp)

    where strApp is the the command line text.

    However this method starts a new process and therefore my application continues without waiting.

    Any ideas?
     
    Guest, Jun 10, 2004
    #1
    1. Advertisements

  2. * "=?Utf-8?B?aHBsbG95ZA==?=" <> scripsit:
    > Hi I want my VB.NET application to run a command from the command line and then wait for the command to finish before continuing.
    >
    > I am currently using
    >
    > System.Diagnostics.Process.Start(strApp)
    >
    > where strApp is the the command line text.
    >
    > However this method starts a new process and therefore my application continues without waiting.


    \\\
    Imports System.Diagnostics
    ..
    ..
    ..
    Dim p As Process = Process.Start("C:\foo.exe")
    p.WaitForExit()
    ///

    --
    Herfried K. Wagner [MVP]
    <URL:http://dotnet.mvps.org/>
     
    Herfried K. Wagner [MVP], Jun 10, 2004
    #2
    1. Advertisements

  3. Guest

    Cor Ligthert Guest

    Re: Running a command line process (Multipost)

    Answered by Jon Skeet in dotnet.general
     
    Cor Ligthert, Jun 10, 2004
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CMG
    Replies:
    6
    Views:
    616
  2. David Eadie
    Replies:
    3
    Views:
    449
  3. Vagabond Software

    Long Path as command-line argument in Process.Start?

    Vagabond Software, Oct 6, 2005, in forum: Microsoft VB .NET
    Replies:
    1
    Views:
    564
  4. Ronald S. Cook

    Dim p As Process = New Process() vs Dim p as New Process()

    Ronald S. Cook, Apr 11, 2007, in forum: Microsoft VB .NET
    Replies:
    6
    Views:
    811
    rowe_newsgroups
    Apr 12, 2007
  5. Kevin Vogler

    Process.Start vs. Command line syntax

    Kevin Vogler, Aug 29, 2008, in forum: Microsoft VB .NET
    Replies:
    7
    Views:
    332
    Kevin Vogler
    Sep 2, 2008
Loading...

Share This Page