I was editing my script with comments for no real reson because I was bored and decided to comment every single part of the script so I can remember how everything works if I ever somehow lost my memory
Why I Made This
I use this everyday because I have to turn off my computer at night, Turn it back on when I wake up etc. My being a real pack rat with lots of experimental crap on my computer that pops up when I start up my computer I decided to make a program that simply stops all these programs as soon as I click "Kill all the processes".
Code
Code:
;Author: Troy/TekiJinn (on elitepvpers)
;Date created: 12/30/2007
;Time created: 9:17 AM
;Script name: Startup Process Killer
;--------------------------------------------------------------------------------------------------------------------------------------
;GUI
#include <GUIConstants.au3> ; tell it to use GUI related constant variables etc.
Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
$mainwindow = GUICreate("Startup Process Killer - By Troy", 210,100) ;my main box thingy
$kill = GUICtrlCreateButton("Kill all the processes!",50,40,110,20) ;kill button
$quit = GUICtrlCreateButton("Exit",90,70) ;exit button
;
;Tell the buttons what to read from when clicked v
GUICtrlSetOnEvent($quit, "quit"); tell the quit button to use my quit function (example: quit = Func quit())
GUICtrlSetOnEvent($kill, "kill"); tell the kill button to use my kill function (example: kill = Func kill())
GUISetOnEvent($GUI_EVENT_CLOSE, "quit");tell the program that when you click that red X at top right of program it uses my quit function
;End of the tell ^
GUISetState(@SW_SHOW) ;Tell it to show my box
While 1 ;loop infinitly
Sleep(1000) ; this basicly keeps my program from quitting right after you open it "Big bug I couldent figure out".
;so if you have any kind of things you want to happen over and over while the program is running you put them here.
WEnd ; end loop
Func quit() ; quit function
Exit ;exit the program
endfunc ;end the function
Func kill() ;kill function
ProcessClose("Network Chat.exe") ; I left my processes in here for example, you can change them to whatever you want closed.
ProcessClose("hpqtra08.exe")
ProcessClose("daemon.exe")
ProcessClose("Nick LaunchPad.exe")
ProcessClose("YahooMessenger.exe")
ProcessClose("msmsgs.exe")
ProcessClose("msnmsgr.exe")
ProcessClose("hpwuSchd2.exe")
ProcessClose("PDVDServ.exe")
ProcessClose("hpqste08.exe")
ProcessClose("mysqld-nt.exe")
ProcessClose("HPZipm12.exe")
ProcessClose("pg_ctl.exe")
;ERROR MESSAGES BELOW~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;These basicly tell me if the process failed to close then I have to use Ctrl+ALT+Del and manually close them.
If ProcessExists("Network Chat.exe") then
MsgBox(0,"Fail","Network Chat failed to close.")
endif
If ProcessExists("hpqtra08.exe") then
MsgBox(0,"Fail","hpqtra08.exe failed to close.")
endif
If ProcessExists("daemon.exe") then
MsgBox(0,"Fail","Daemon failed to close.")
endif
If ProcessExists("Nick LaunchPad.exe") then
MsgBox(0,"Fail","Nick Launch Pad failed to close.")
endif
If ProcessExists("YahooMessenger.exe") then
MsgBox(0,"Fail","Yahoo Messenger failed to close.")
endif
If ProcessExists("msmsgs.exe") then
MsgBox(0,"Fail","msmsgs.exe failed to close.")
endif
If ProcessExists("msnmsgr.exe") then
MsgBox(0,"Fail","MSN Messenger failed to close.")
endif
If ProcessExists("hpwuSchd2.exe") then
MsgBox(0,"Fail","hpwuSchd2.exe failed to close.")
endif
If ProcessExists("PDVDServ.exe") then
MsgBox(0,"Fail","Power DVD Server failed to close.")
endif
If ProcessExists("hpqste08.exe") then
MsgBox(0,"Fail","hpqste08.exe failed to close.")
endif
If ProcessExists("mysqld-nt.exe") then
MsgBox(0,"Fail","MySQL Server failed to close.")
endif
If ProcessExists("HPZipm12.exe") then
MsgBox(0,"Fail","HPZipm12.exe failed to close.")
endif
If ProcessExists("pg_ctl.exe") then
MsgBox(0,"Fail","pg_ctl.exe failed to close.")
endif
If ProcessExists("postgres.exe") then
MsgBox(0,"Fail","postgres sql server failed to close.")
endif
msgbox(0,"Sucess!","Done")
Exit
EndFunc ;end the function






