Close IE Browser From Windows Command Line

Status
Not open for further replies.

Zohn_Winchester

Beta member
Messages
2
Hello all:

I know that I can open an IE browser from the windows command line. (typing "start iexplore" after the command prompt) But I dont know HOW TO CLOSE ALL OF THE IE BROWSER WINDOWS FROM THE COMMAND LINE.

Can somebody give me some comments/tips? Many thanks in advance...

Winchester
 
Thanks, Nix.

But it is not from the command line. I want to write some commands in a batch file. Commands such as open a brower, then execute an exe file to down load some stuff from a website, and finally close the browser. I can realize the first 2 steps, but just dont know how to close the browser...

Winchester
 
There isn't a way to do this that I have been able to find. The only way is to build a script that does it. I have found several Installscripts that work, but nothing that does it for the standard gui...
Good Luck
 
Hi,
You can do it with a vbscript from the command line. Paste this into notepad and save as CloseIE.vbs. Everything inbetween the asterisks.
************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'Iexplore.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
***************************
You can replace iexplore.exe with any process you want. run the script from the commandline and voilla!
 
Status
Not open for further replies.
Back
Top Bottom