One of the frustrations that I have experienced in the past is the unstoppable application. This might be a virus or spyware or that annoying program with the “fingernails on the chalkboard” sound effects. Any way you look at it, I’ve always thought that it would be wonderful to be able to kill these programs as soon as they started (not to mention the possibility for pranks is endless). So I wrote a program!
The You’ve Been Warned Paragraph
Be very careful with this program. It is possible to configure this program so that you can never run Windows properly again! Use this program wisely and responsibly.
The Script
This is a relatively simple AutoIt script. It grabs two things from an INI file called AppKill.ini. The first is a pause setting. This tells the program how often to check for new applications.
The second is a list of applications that should not be allowed to run. When ever one of these applications is found, it is automatically killed.
Here is the code:
; Application Killer Dim $AppArray Dim $ConfigFile Dim $Pause TraySetToolTip("Application Killer") $ConfigFile = _GetConfigFile("AppKill.ini") $Pause = Number(IniRead($ConfigFile, "General", "Pause", 10)) $AppArray = IniReadSection($ConfigFile, "Applications") While 1 For $Count = 1 To $AppArray[0][0] If ProcessExists($AppArray[$Count][1]) Then ProcessClose($AppArray[$Count][1]) EndIf Next Sleep(1000 * $Pause) WEnd #region Functions Func _GetConfigFile($filename, $silent = False) Local $configfilename $configfilename = @ScriptDir & "\" & $filename If Not FileExists($configfilename) Then If Not $silent Then MsgBox(16, "File Missing", "The file " & $filename & " is not available." & @CRLF & "Please ensure that it is located in the " & @ScriptDir & " directory." & @CRLF & "The application will now exit.") Exit EndIf SetError(1) Return "Error" EndIf Return $configfilename EndFunc ;==>_GetConfigFile #endregion
Download this code: AppKill.au3
If you don’t want to have to compile the script yourself, here is the precompiled executable.
The example INI file provided checks for new applications every 1 second and will not allow Notepad.exe to run.
[General] Pause=1 [Applications] Application1=Notepad.exe
Download this code: AppKill.ini
Conclusion
While this is a relatively simple and quick script, it is also a very powerful one that can help you to keep your system under control. But, as I’ve warned you, use it wisely.
| Trackback link - http://www.dailycupoftech.com/stop-applications-from-running/trackback/ |
|


March 28th, 2007 at 5:18 pm
Perform MD5 Using AutoIt Providing User Feedback In AutoIt Recovering Your Lost Passwords Reducing the USB Threat Remote Control Mac From Windows Setting Up FTP Access in FreeNAS Spam Filter Busters Stop Applications From Running Stop Bleeding Personal Information Support DCoT System Auditor USB Key Tech Blog of the Week Submissions Thank You! Top 100 Torpark Installer Tracking Users, IP’s, and Computers Upgrade Ubuntu 6.06 to 6.10