VB6.0 - How can i end a running proccess to my windows2000

Posted on 2006-05-09
Last Modified: 2008-03-17
Hello experts ..

I want to end a running proccess to my windows2000 using vb project .. i have a source that is work only on windowsXP , please if you know the source for the windows2000 pls help me!

Question by:KingSencat
    1 Comment
    LVL 19

    Accepted Solution

    Public Function EndProcess(ByVal sbFilename As String) As String
        Dim Process As Variant
        EndProcess = "Can't terminate process :("
        For Each Process In GetObject("winmgmts:").ExecQuery("select * from Win32_Process")
            If LCase(Process.Name) = LCase(sbFilename) Then
                EndProcess = Process.Name & " Terminated once and for all!"
            End If
    End Function

    Private Sub Command1_Click()
        MsgBox EndProcess("iexplore.exe")
    End Sub


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now