vb.net shell command help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blastman
    New Member
    • Sep 2007
    • 3

    vb.net shell command help!

    hey all i'm new in here so hello to all!!!

    right down to business,

    I have a little project for work that does several tasks.

    the one i'm having issues with is a on a form of mine.

    I'd like to start a bat file via the shell command but wait for the bat file to finish before popping up a messagebox,show ("completed" )

    any ideas?

    I'm very new to all of this so please forgive me if i've missed something important)

    cheers in advance
  • blastman
    New Member
    • Sep 2007
    • 3

    #2
    I have the answer.

    Start a new process (Notepad).
    '
    Dim myProcess As Process = System.Diagnost ics.Process.Sta rt("MyTextFile. txt")
    '
    ' Wait until it ends.
    '
    myProcess.WaitF orExit()

    MessageBox.Show ("Notepad ended: " & myProcess.ExitT ime & "." & _
    System.Environm ent.NewLine & "Exit Code: " & myProcess.ExitC ode)
    '
    ' Close the process to free resources.
    '
    myProcess.Close ()

    works for me.

    :-)

    Comment

    Working...