Re: Stoping IE and removing it from memory

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 08/06/04


Date: Fri, 06 Aug 2004 16:30:23 +0200

Richard Bell wrote:

> I'm relatively new to WSH and VBSCRIPT. I'm looking for a reliable
> way to stop IE and remove it from memory. When I do an
>
> ie.Quit
>
> IE stops and the visible window is removed from the screen.
> Unfortunately, iexplorer remains in the process list. How do I stop
> it and get it truely out of memory?
>
> Thanks.
Hi

ie.Quit works fine for me, iexplore.exe disappears from the task
list.

To be sure IE is killed, after ie.Quit, you can run this:

sComputer = "." ' use "." for local computer
Set oWmi = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & sComputer & "\root\cimv2")

Set colProcessList = oWmi.ExecQuery _
    ("Select * from Win32_Process Where Name = 'iexplore.exe'")

For Each oProcess in colProcessList
    oProcess.Terminate()
Next

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx


Relevant Pages

  • Re: Stoping IE and removing it from memory
    ... > way to stop IE and remove it from memory. ... > IE stops and the visible window is removed from the screen. ... Set oWmi = GetObject("winmgmts:" _ ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.wsh)
  • Re: Out of memory! When running perl script on windows
    ... i used to do scripting for Bioinformatics and still doing it. ... undef after parsing, and before doing other task, to save memory. ... check that you aren't creating cyclic data structures: ... perl has quite a bit overhead for each object: ...
    (comp.lang.perl.misc)
  • Re: Scripting Performance after SP2 applied?
    ... I agree that there is a lot of time spent setting up the scripting in the ... As far as memory configuration, I have always set my max server memory set ... now with forced parameterization, ... I then restarted SQL Server, and set the database to forced ...
    (microsoft.public.sqlserver.tools)
  • Re: delete running process in WIN XP
    ... Here is a vbscript using WMI to terminate notepad.exe: ... Set oWmi = GetObject("winmgmts:" _ ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Scriptable dynamic forms applications
    ... Well, best part of the story -don't laugh- is that DWS doesn't use Delphi strings, but actually uses variant strings. ... Speed wasn't directly an ansi vs unicode affair, but more an issue with how much memory was used, at some point the .Net GC becomes a slug and instead of using f.i. ... MB of memory for 1 MB of string data, it started using closer to 100 MB of RAM. ... This is the kind of things that scares me about using .Net for scripting. ...
    (borland.public.delphi.non-technical)

Loading