Sign in to follow this  
Followers 0
Israel

Killing zombies processes of Internet Explorer

11 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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])
Next

Or 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])
Next

You 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 by ViciousXUSMC
1 person likes this

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

the problem was that he had more cases opened it.

I used the ViciousXUSMC functions and worked here.

Thank you so much

Share this post


Link to post
Share on other sites

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 _WingGetProcess

Any suggestion ?

Share this post


Link to post
Share on other sites

Israel,

1.  How are these IE instances created?

2. Answer post #2

3. 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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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
EndFunc

This 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).

 


False Positive Reporter - Mass email all anti virus vendors with an attachment of your program for fast and easy whitelisting.

PortableApps.com App Creation Wizard  - A simple GUI-based Wizard for creating PortableApps.

SoundBoard - Play any song or sound you want at the press of a hotkey.

My GitHub Page: https://github.com/BetaLeaf

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0