Jump to content
Sign in to follow this  
MerkurAlex

Process list killer *simple*

Recommended Posts

MerkurAlex

It basically takes a list and kills the processes.

Code

#include <array.au3>
#include <file.au3>
$list=fileopendialog("Process list killer",@scriptdir,"Text files (*.txt)")
if $list="" Then
    msgbox("","","No file selected.")
    exit
EndIf
$read=_arraycreate("")
$rlist=_FileReadToArray($list,$read)
_arraydisplay($read,"Your selected list.")
for $i=1 to $read[0]
    if processexists($read[$i]) and not $read[$i]="" then processclose($read[$i])
next

Example list.txt

Ventrilo.exe
Trillian.exe
Xfire.exe
Autoit3.exe

Its simple i know but it can be useful if you have alot of processes that don't need to be open.

I may make a list creator later if i do ill post it here.

Edited by EagleClaw

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites
MerkurAlex

Here is a quick list creator also updated the actual code on the post above.

#include <GUIConstants.au3>
#include <GUIlistview.au3>

$form = GUICreate("Process list killer - list creator", 290, 269, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$plist = GUICtrlCreateListView("Process name", 0, 1, 125, 241)
$slist = GUICtrlCreateListView("Process name", 164, 0, 125, 241)
$addbtn = GUICtrlCreateButton(">>", 127, 48, 35, 24, 0)
$delbtn = GUICtrlCreateButton("Delete", 127, 168, 36, 20, 0)
$sbtn = GUICtrlCreateButton("Save it im done!", 1, 246, 288, 21, 0)
GUISetState(@SW_SHOW)
$processlist=processlist()
for $i=1 to $processlist[0][0]
    guictrlcreatelistviewitem($processlist[$i][0],$plist)
next

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $addbtn
            $plistsel=_GUICtrlListViewGetItemText($plist)
            GUICtrlCreateListViewItem($plistsel,$slist)
        case $delbtn
            $slistsel=_GUICtrlListViewGetCurSel($slist)
            if not $slistsel="" Then _GUICtrlListViewDeleteItem($slist,$slistsel)
        case $sbtn
            $amount=_GUICtrlListViewGetItemCount($slist)
            guisetstate(@SW_HIDE,$form)
            $file=fileopendialog("Process list killer - list creator",@scriptdir,"TXT files(*.txt)")
            $fo=fileopen($file,2)
            for $i=0 to $amount
                filewrite($fo,_GUICtrlListViewGetItemText($slist,$i)&@crlf)
            next
            fileclose($fo)
            shellexecute($file)
            exit
    EndSwitch
WEnd

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites
FireLord

Nice, I actually made one quite similar to this one.


[center]See the Helpfile[/center]
While Alive()
	 DrinkWine();
}
[center][/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×