Process kill .bin

3t3r4n

New member
Joined
Mar 10, 2011
Messages
1
Programming Experience
1-3
VB.NET:
Public Class Form1
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        For Each RunningProcess In Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName)
            If (Not RunningProcess.Id = Process.GetCurrentProcess().Id) Then
                RunningProcess.Kill()
            End If
        Next
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        For Each RunningProcess In Process.GetProcessesByName("mc")
            RunningProcess.Kill()
        Next
    End Sub
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Me.Hide()
        ShowInTaskbar = false
        Timer2.Enabled = False
    End Sub
End Class

Hi I have this code to close a process but it work only to .exe and i don't know how to close .bin type (i want to stop mc.exe but don't work for metin2client.bin ) please help me!
 
To kill a certain process you may need Premission, as even being admin on the current machine doesn't count as some services are strictly controlled by the "OS", try see who the owner of the process is and work from their, allways GET permission, Secondly make sure it's not a windows functioning service that's needed or you could run into problems.
 
Try this...

VB.NET:
[COLOR=blue]Dim[/COLOR] theProcess [COLOR=blue]As[/COLOR] [COLOR=#2b91af]Process[/COLOR]() = [COLOR=#2b91af]Process[/COLOR].GetProcessesByName([COLOR=#a31515]"metin2client.bin"[/COLOR])        
[COLOR=blue]Try[/COLOR]            
[COLOR=blue]      For[/COLOR] inx [COLOR=blue]As[/COLOR] [COLOR=blue]Integer[/COLOR] = theProcess.Count - 1 [COLOR=blue]To[/COLOR] 0 [COLOR=blue]Step[/COLOR] -1                
           theProcess(inx).Kill()            
[COLOR=blue]      Next[/COLOR]        
[COLOR=blue]Catch[/COLOR]            
      MsgBox(ErrorToString)        
[COLOR=blue]End[/COLOR] [COLOR=blue]Try
[/COLOR]
 
Back
Top