• Ich hatte Jahre lang das Problem, dass immer mal Prozesse abgestürzt sind, wie Windoof halt so ist.
    Also habe ich mir ein programmm gebaut, welches Prozesse abschießen kann, und zwar mehrere auf einmal (naja fast), und auf Wunsch in ner Schleife.
    Nennt sich GLi Kill:
    Download im heise Software-Verzeichnis
    Gibt es noch Verbesserungsvorschläge?

    [autoit]

    #NoTrayIcon
    #RequireAdmin
    #region
    #AutoIt3Wrapper_icon=b.ico
    #AutoIt3Wrapper_outfile=kill.exe
    #AutoIt3Wrapper_compression=4
    #AutoIt3Wrapper_Change2CUI=y
    #AutoIt3Wrapper_res_comment=GLI ProcKiller 2.0.0.20
    #AutoIt3Wrapper_res_description=tool to kill processes
    #AutoIt3Wrapper_res_fileversion=2.0.0.20
    #AutoIt3Wrapper_res_legalcopyright=2008 by GLI
    #endregion
    Dim $PROCTE, $S, $F = 0
    If $CMDLINE[0] <> 0 And $CMDLINE[1] = "/n" Then $F = 1
    If $CMDLINE[0] <> 0 And $CMDLINE[1] = "/l" Then
    If $CMDLINE[0] >= 2 And $CMDLINE[2] = "/n" Then $F = 1
    $LOOP = 1
    HotKeySet("#{BS}", "loopend")
    While True
    For $S = $CMDLINE[0] To 0 Step -1
    $PROCTE = StringRight($CMDLINE[$S], 4)
    If $PROCTE = ".exe" Or $F = 1 Then ProcessClose($CMDLINE[$S])
    If $PROCTE <> ".exe" And $F <> 1 Then ProcessClose($CMDLINE[$S] & ".exe")
    Next
    WEnd
    EndIf
    For $S = $CMDLINE[0] To 0 Step -1
    $PROCTE = StringRight($CMDLINE[$S], 4)
    If $PROCTE = ".exe" Or $F = 1 Then ProcessClose($CMDLINE[$S])
    If $PROCTE <> ".exe" And $F <> 1 Then ProcessClose($CMDLINE[$S] & ".exe")
    Next
    If $CMDLINE[0] = 0 Then
    HotKeySet("{enter}", "loopend")
    ConsoleWrite("###################################" & @CRLF & "# GLi Kill 2.0.0.20 #" & @CRLF & "# © 2008 GLi Labors international #" & @CRLF & "###################################" & @CRLF & @CRLF & "kill [/l] [/n] [/w] [/u] <proc1> <proc2> ... <procn>" & @CRLF & @CRLF & "Parameters:" & @CRLF & @TAB & "/l" & @TAB & @TAB & "loop killing processes. To quit, press win+backslash" & @CRLF & @TAB & "/n" & @TAB & @TAB & "not an .exe file" & @CRLF & @TAB & "/w" & @TAB & @TAB & "Shut system immediatly down" & @CRLF & @TAB & "/u" & @TAB & @TAB & "Uninstall" & @CRLF & @TAB & "process name" & @TAB & "Name of the process to kill." & @CRLF & @CRLF & "Examples:" & @CRLF & @TAB & "kill process1 process2 process3" & @CRLF & @TAB & "kill /n process1.exe process2.dat process3.001" & @CRLF & @TAB & "kill /l process1 process2 process3" & @CRLF & @TAB & "kill /l /n process1.exe process2.dat process3.001" & @CRLF & @TAB & "kill /w" & @CRLF & @TAB & "kill /u" & @CRLF & @CRLF & @CRLF & "Press enter to exit..." & @CRLF)
    While True
    Sleep(10)
    WEnd
    EndIf
    If $CMDLINE[0] = 1 And $CMDLINE[1] = "/u" Then
    UNIN()
    EndIf
    If $CMDLINE[0] <> 0 And $CMDLINE[1] = "/w" Then Shutdown(13)

    [/autoit][autoit][/autoit][autoit]

    Func LOOPEND()
    HotKeySet("#{BS}")
    Exit
    EndFunc

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Func UNIN()
    $UNMSG = MsgBox(32 + 4, "Attention!", "Do you really want to uninstall?")
    If $UNMSG = 7 Then Exit
    RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GLIkill")
    DirRemove(@StartMenuCommonDir & "\GLI", 1)
    Run('cmd.exe /C del "' & @ScriptDir & '"')
    Exit
    EndFunc

    [/autoit]

    Twitter: @L3viathan2142
    Benutze AutoIt persönlich nicht mehr, da ich keinen Windows-Rechner mehr besitze.

  • Prozesse anhalten:

    Spoiler anzeigen
    [autoit]

    Func _ProcessSuspend($process)
    $processid = ProcessExists($process)
    If $processid Then
    $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid)
    $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0])
    DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
    If IsArray($i_sucess) Then
    Return 1
    Else
    SetError(1)
    Return 0
    Endif
    Else
    SetError(2)
    Return 0
    Endif
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _ProcessResume($process)
    $processid = ProcessExists($process)
    If $processid Then
    $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid)
    $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0])
    DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle)
    If IsArray($i_sucess) Then
    Return 1
    Else
    SetError(1)
    Return 0
    Endif
    Else
    SetError(2)
    Return 0
    Endif
    EndFunc

    [/autoit]