End Process from Task Manager using VB 6 Code

后端 未结 8 1257
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 03:14

I need to kill an application roughly so I can get phantom subscriber of that application in my database (this can not be produced by closing the application). Manually, if

8条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-13 03:30

    Here is my code in vb6 to kill process by name

    It works for me

     Private Sub TerminateProcess(ProcessName As String)
            Dim Process As Object
            For Each Process In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = '" & ProcessName & "'")
                Process.Terminate
            Next
    End Sub
    

提交回复
热议问题