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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Rob

    Running WinZip command line from VB.Net

    Rob, Oct 5, 2003, in forum: Microsoft VB .NET
    Replies:
    3
    Views:
    1,437
  2. CMG
    Replies:
    6
    Views:
    802
  3. guy levi

    Running command line programs from vb.net

    guy levi, Dec 30, 2003, in forum: Microsoft VB .NET
    Replies:
    3
    Views:
    461
  4. Atley

    Running Command Line statements

    Atley, Feb 9, 2004, in forum: Microsoft VB .NET
    Replies:
    9
    Views:
    286
    Atley
    Feb 26, 2004
  5. David Eadie
    Replies:
    3
    Views:
    620
  6. Vagabond Software

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

    Vagabond Software, Oct 6, 2005, in forum: Microsoft VB .NET
    Replies:
    1
    Views:
    805
  7. 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:
    1,303
    rowe_newsgroups
    Apr 12, 2007
  8. Kevin Vogler

    Process.Start vs. Command line syntax

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