Israel Posted August 10, 2015 Share Posted August 10, 2015 Good afternoon,Is there any way to kill zombies processes internet explorer? I'm using the ProcessClose and ProcessWaitClose functions but is not working, it seems that does not recognize the processes.Thank you Link to comment Share on other sites More sharing options...
kylomas Posted August 10, 2015 Share Posted August 10, 2015 Israel,Can you post what you have tried?Kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted August 10, 2015 Share Posted August 10, 2015 (edited) I imagine it may because you have multiple processes with the same name and just using the process name will not close each different PID.To work around that you can do something like this.Local $sString = "name" Local $list = ProcessList() For $i = 1 To $list[0][0] If StringRegExp($list[$i][0], "^" & $sString & "\d+\.exe$") Then ProcessClose($list[$i][1]) NextOr if you suck at RegEx like me StringinStr() works as well.Local $list = ProcessList() For $i = 1 To $list[0][0] If StringinStr($list[$i][0], "notepad") Then ProcessClose($list[$i][1]) NextYou can test what I am talking about by changing the last "1" in the ProcessClose() to 0 and then it closes the process by name instead of PID, open more than one notepad and you will see it close one instead of all of them. Edited August 10, 2015 by ViciousXUSMC Israel 1 Link to comment Share on other sites More sharing options...
kylomas Posted August 10, 2015 Share Posted August 10, 2015 Hmmm, perhaps by "zombie" the OP means child processes. That is why I asked for what he/she has tried. Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Israel Posted August 11, 2015 Author Share Posted August 11, 2015 the problem was that he had more cases opened it.I used the ViciousXUSMC functions and worked here.Thank you so much Link to comment Share on other sites More sharing options...
Israel Posted August 12, 2015 Author Share Posted August 12, 2015 I'm another problem now.IE when you are with an open window it becomes the parent process, and the other tabs or windows that are created become children of this process.Kill all processes before creating my window is not my solution, since in a situation where I need another IE window open it will close automatically.I need to kill the process I create at the end of my test, so far I can get the id of the parent process, but I can not take the child process that was created.The function I use is _WingGetProcessAny suggestion ? Link to comment Share on other sites More sharing options...
kylomas Posted August 12, 2015 Share Posted August 12, 2015 Israel,1. How are these IE instances created?2. Answer post #23. What is _WingGetProcess?Kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Israel Posted August 12, 2015 Author Share Posted August 12, 2015 local $oie = _IECreate("www.myapp.com.br") local $window = WinWait("[CLASS:IEFrame]", "", 10) local $process = WinGetProcess(WinGetHandle($window)) ; the application does what it has to do ; when finished _IEAction($oie,"quit") ProcessClose($process)Kylomas,My code is the one above, can not go much in detail because it is a professional application. My goal is to kill a process that I created, but this process can be my son Link to comment Share on other sites More sharing options...
JohnOne Posted August 12, 2015 Share Posted August 12, 2015 One option is to implement _WinAPI_CreateJobObject() and _WinAPI_TerminateJobObject() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
EmilyLove Posted August 12, 2015 Share Posted August 12, 2015 ProcessCloseAll("iexplorer.exe") Func ProcessCloseAll($Process);Same as ProcessClose, except it closes all pid for that Process name. Global $Processes = ProcessList($Process);get all currently running Processes ;OP, ShellExecute whatever window or program you need to remain open. You should also add a Sleep() timer after this line. For $i = 1 To $Processes[0][0]; For Each found unique PID ProcessClose($Processes[$i][1]);Close Process Next EndFuncThis is the function I use to close multiple pid sharing the same process name at once. I placed a comment where you should ShellExecute() if you need that process to stay open(this will not work if your app required the parent PID to remain open). Link to comment Share on other sites More sharing options...
JohnOne Posted August 12, 2015 Share Posted August 12, 2015 (edited) Thing is, that will not only close child processes, but also siblings, parents, grandparents and non related processes. Edited August 12, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now