0

If i open manually some IE, and then make a registry change, when i open a new instance it will show the change (per example the useragent)

If i do this in VBS:

Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "www.download.com"
ie.Visible = True

It will open a new instance of IE but it will NOT show the changes i made before in the registry, why?

What i am looking is to change the proxy and/or the useragent. It works fine when i manually open the IE after making changes in the registry, but does not work in if create the new IE instance using VBS.

Any help are welcome!!

1 Answer 1

0

You code doesn't create a new instance of IE. Remember IE is one IE to control other IEs.

See how child process have the PID of parent in command line. See the embedding switch (means started by COM).

CommandLine                                                                   Name          ProcessId  

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" -Embedding                 iexplore.exe  3260       

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" SCODEF:3260 CREDAT:145409  iexplore.exe  2080       

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" SCODEF:3260 CREDAT:145411  iexplore.exe  864        

Now I open another IE from start menu.

CommandLine                                                                  Name          ProcessId  

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" -Embedding                 iexplore.exe  3260       

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" SCODEF:3260 CREDAT:145409  iexplore.exe  2080       

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" SCODEF:3260 CREDAT:145411  iexplore.exe  864        

"C:\Program Files\Internet Explorer\iexplore.exe"                            iexplore.exe  2800       

"C:\Program Files\Internet Explorer\iexplore.exe" SCODEF:2800 CREDAT:79873   iexplore.exe  2568       

See we now have two host IE, one with the new one and one with the old one.

5
  • Thnaks for your answer. But im running this code from my desktop in a vbs file. And it does not show the registry changes. Im not running this code from inside some IE. So i understand what you mean, but does not see how to avoid it. How can i open another instance from vbs. Jul 24, 2014 at 0:48
  • I want to open some IE from a vbs code, and i want that IE to show registry changes, just as if i open a new instance. It is possible? Thanks for the time to repoly my answer :) Jul 24, 2014 at 0:53
  • Open a new instance and use this to get a reference Set objShell = CreateObject("Shell.Application"):Set AllWindows = objShell.Windows:For Each window in AllWindows:msgbox window.locationname:Next
    – D.Ddgg
    Jul 24, 2014 at 0:59
  • Thanks, but how to create a new instance using vbs? If i run a vbs from outside any IE and all IE are closed (need to be closed even if we run the vbs from outside the IE?). Does it open a new instance? Last question: how did you see the parent that you showed me? Thanks again and esxcuse me for asking too much. Jul 24, 2014 at 13:07
  • Just execute a new instance of IE, wshshell.run "iexplore www.site.com", (I gave the IE way above - this if office type way but may work for IE but not sure as IE doesn't list itself in the Running Object Table) then use Set x = GetObject(,"www.site.com"). Task info can be got from tasklist /v and wmic process get /format:list.
    – D.Ddgg
    Jul 24, 2014 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.