views:

39

answers:

1

Hi I would like to start the Internet Explorer without extensions and control it. (Navigate to other pages, click buttons etc.)

When I use the command: "Start iexplore.exe -ArgumentList -extoff" I have the IExplore without extensions, but no object. I need the object to navigate to different pages and click buttons. "$ie = Start iexplore.exe -ArgumentList -extoff" is not possible with the Command "Start X"

The following code create a Com Object and all I want is possible without the "Extensions = off"

  • $ie = New-Object -ComObject InternetExplorer.Application
  • $ie.Navigate("http://www.stackoverflow.com")
  • $ie.Navigate("www.Navigate to a other Page.com")
  • $ie.Document.getElementById("ButtonID")|foreach{
  • $_.Click()
  • }
A: 

This is a real hack but you could tweak the COM startup commandline for IE to pass in the argument -extoff. The registry entry to start IE on my machine (with IE9) is:

HKEY_CLASSES_ROOT\CLSID{0002DF01-0000-0000-C000-000000000046}\LocalServer32

Note that you might need to override the regkey permissions to edit the value.

Keith Hill
Hey Keith, thank you very much! Can you tell me more about the editing? I found: HKEY_CLASSES_ROOT\InternetExplorer.Application\CLSID but what must I edit?
LaPhi
sorry HKEY_CLASSES_ROOT\CLSID\{0002DF01-0000-0000-C000-000000000046} is my IE
LaPhi
You edit the default value of the LocalServer32 regkey. The value is the commandline that starts the IE.exe. Just append -extoff outside the double quotes e.g. `"C:\Program Files\Internet Explorer\iexplore.exe" -extoff`. Once again, this is a hack but it might work for you.
Keith Hill