Hello.
Can somebody share the code for ending the process of all open programs including explorers. Thanks.
Printable View
Hello.
Can somebody share the code for ending the process of all open programs including explorers. Thanks.
You will not be able to kill all running processes on a Windows machine. The OS prevents you from killing critical services. You can kill explorer.exe, because its just a shell, but you can't terminate all programs.Quote:
Originally Posted by Erroneous
Its probably not 100% impossible, but doing so in normal mode would cause it to become so instable that nothing else would function.
I'm not including the system process. Only the opened applications like word, excel, internet explorer or explorers only or any other softwares. IS this possible with VB to detect them and end process all of them regardless of how many programs are opened?
It is possible to do it with a loop, assuming you have rights to kill it. If you are running as Admin it is much easier than trying to pass the necessary credentials.Quote:
Originally Posted by Erroneous
The best option would be a loop.
I'm doing it with my personal computer. I have all the rights. OK do it in a loop. How would I know which one to close? Is there an API for this?
Here is a good example on how to list and kill processes in VB:
TheScarms
I hope that helps
yes i have seen programs that can act like task manager and can show you all of the processes and give you the option to end one. try searching the codebank or a source code website whoose name i dont think i am allowed to mention since it would be advertising
OK. I'll play with the TerminateProcess API for the moment. Thanks for replying. I have work with terminate process but I can only terminate one process by the application name. I can't find the logic to find every opened app then end their lives forever. :)
Thanks for the link Capp. I see i need the use of SendMessage then fire WM_CLOSE to every one of them.
Try this link by Bushmobile. It closes all open explorer.
http://www.vbforums.com/showpost.php...11&postcount=4