![]() |
[VB.Net] [Snippet] Anti-unwanted Process - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: [VB.Net] [Snippet] Anti-unwanted Process (/Thread-VB-Net-Snippet-Anti-unwanted-Process) |
[VB.Net] [Snippet] Anti-unwanted Process - Coder-san - 04-03-2011 Code: Dim AntiProcess() As String = {"notepad", "mspaint", "taskmgr"} 'etc This will send close message / end all the Process (even multiple instances) in the AntiProcess() if they are not locked or have some other cool security. RE: [VB.Net] [Snippet] Anti-unwanted Process - Coder-san - 04-03-2011 Credits to [link=http://www.windowsitpro.com/article/registry2/how-can-i-stop-and-start-services-from-the-command-line-.aspx]WindowsITpro[/link] Code: Shell("net stop servicename") RE: [VB.Net] [Snippet] Anti-unwanted Process - Coder-san - 04-03-2011 I'm not sure, but it works. Just takes a few seconds. RE: [VB.Net] [Snippet] Anti-unwanted Process - nosferatus - 04-04-2011 Thank you for the snippet. Tested and working great. What is even more great, is you can add a timer and make it check if any of the apps is running at all time. Code: Public Class Form1 |