Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running a .bat file
Message
 
À
09/07/2004 10:24:38
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00922451
Message ID:
00922510
Vues:
17
This message has been marked as the solution to the initial question of the thread.
>And what do I declare MyProcess as? I tried as System.Diagnostics.Process but that was not correct. Thanks!
>
>MAC


It is working for me!

Here is my code in a test application:
    Dim MyProcess As New Process

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MyProcess.StartInfo.FileName = "notepad.exe"
        MyProcess.StartInfo.WorkingDirectory = "c:\temp"
        MyProcess.StartInfo.Arguments = "Test.txt"
        MyProcess.Start()

        MyProcess.WaitForExit()
        MessageBox.Show("It was time!!!", "Process has now exited")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MyProcess.StartInfo.FileName = "c:\temp\test.bat"
        'MyProcess.StartInfo.WorkingDirectory = "c:\temp"
        MyProcess.Start()

        MyProcess.WaitForExit()
        MessageBox.Show("It was time!!!", "Process has now exited")
    End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform