• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

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

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!



thanks
0
KingSencat
Asked:
KingSencat
1 Solution
 
ShauliCommented:
'function
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
            Process.Terminate
            EndProcess = Process.Name & " Terminated once and for all!"
        End If
    Next
End Function

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

S
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now