Results 1 to 4 of 4

Thread: [RESOLVED] Process start and stop using vb.net application

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Location
    Kolkata, India
    Posts
    290

    Resolved [RESOLVED] Process start and stop using vb.net application

    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

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Process start and stop using vb.net application

    What have you tired your self? You should obviously be using the forms load and formclosing events.

  3. #3
    Fanatic Member
    Join Date
    Oct 2011
    Location
    Sydney, Australia
    Posts
    756

    Re: Process start and stop using vb.net application

    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
    My CodeBank Submissions
    • Listbox with transparency and picture support - Click Here
    • Check for a true internet connection - Click Here
    • Open Cash drawer connected to receipt printer - Click Here
    • Custom color and size border around form - Click Here
    • Upload file to website without user logins, includes PHP - Click Here
    • List All Removable USB Storage Devices - Click Here
    • Custom On/Off Slide Control - Click Here
    • Insert multiple rows of data into one database table using parameters - Click Here
    • Trigger USB/Serial Cash Drawer - Click Here

  4. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Process start and stop using vb.net application

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width