Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running a .bat file
Message
 
To
09/07/2004 10:24:38
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00922451
Message ID:
00922510
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform