Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 615879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:16:02+00:00 2026-05-13T18:16:02+00:00

I am developping a Windows Service in Visual Basic, witch will start an *.exe

  • 0

I am developping a Windows Service in Visual Basic, witch will start an *.exe when starting. It’s working pretty fine. Now how can I stop this *.exe while stopping this windows service? My code is as below:

Public Class MyWinService
Dim RetVal
Protected Overrides Sub OnStart(ByVal args() As String)
    EventLog.WriteEntry("MyService Started")

    RetVal = Shell("JobService.exe", 1)

End Sub

Protected Overrides Sub OnStop()
    EventLog.WriteEntry("MyService Stopped")
End Sub

Protected Overrides Sub OnPause()
    EventLog.WriteEntry("MyService Paused")
End Sub

Protected Overrides Sub OnContinue()
    EventLog.WriteEntry("MyService Resumed")
End Sub

Protected Overrides Sub OnCustomCommand(ByVal command As Integer)
    If command = 200 Then
        EventLog.WriteEntry("Custom Command 200 invoked")
    ElseIf command = 210 Then
        EventLog.WriteEntry("Custom Command 210 invoked")
    End If
End Sub

Private Sub Process1_Exited(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:16:02+00:00Added an answer on May 13, 2026 at 6:16 pm

    Use the Process.Kill method. This assumes that you have the process handle from Process.Start, or that you have obtained it in some other way.

    As you already have the process ID from the Shell command, you can retrieve the process:

    Dim myProcess = Process.GetProcessById(RetVal)
    

    Then Kill it:

    myProcess.Kill()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am totally a newbie to VB.net, now I am developping a Windows Service,
I'm currently working on developing a windows service which will be deployed to all
I am developing a very basic windows service in C#. Apart from the service
I'm very beginner for developping. environment is .. Windows XP Professional SP3 Microsoft Visual
I'm developing a Windows service which will run at a specific time every day.
We're developing a windows service which will act as a sort of 'slave' process.
I'm developing a Windows Service in VB.NET 2008, but I feel like I'm going
I am developing a .NET Windows service that is creating a couple of threads
I am developing large data collecting ASP.Net/Windows service application-pair that uses Microsoft SQL Server
I'm developing an Android client for a WCF service. There is a windows app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.