Results 1 to 3 of 3

Thread: Kill process?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2011
    Posts
    85

    Kill process?

    Hi guys.

    I have 2 buttons.

    Button1:

    Process.Start(start.bat)

    and when I press button2 , I want start.bat to close..

    How I can do that ????

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Kill process?

    Create an object of Process class and use it to start it. After finishing you could kill that process via that object itself. Details: http://visualbasic.about.com/od/usingvbnet/a/prstrt.htm

    Otherwise, you could kill process that you want by using this way: http://vbnetsample.blogspot.com/2007...l-process.html


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Kill process?

    Your already creating a Process object. Process.Start returns a Process object. Just call Kill on that object.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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