Hi,
I need to run a .exe using vb.net application and when vb.net application close then .exe also closed.
If application by 5 user then .exe also start 5 time and when particular user close the application then that exe process close not all.
thank
Printable View
Hi,
I need to run a .exe using vb.net application and when vb.net application close then .exe also closed.
If application by 5 user then .exe also start 5 time and when particular user close the application then that exe process close not all.
thank
What have you tired your self? You should obviously be using the forms load and formclosing events.
Im not sure what you mean by user 5 but
Code:Public Class Form1
Dim myProcess As New Process
Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
myProcess.Kill()
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.Start()
End Sub
End Class
You really shouldn't use Kill unless you need to terminate a process that is not responding.
You should attempt to close the window first so apps can ask the user if they want to save their work before they exit if need be.
There are few good examples posted here.
One of them that might be worth looking at,..
http://www.vbforums.com/showthread.php?t=643527