How to properly close Internet Explorer when launched from PowerShell?

后端 未结 6 1920
长情又很酷
长情又很酷 2020-12-06 06:43

There was a set of recently asked questions about doing something with Internet Explorer via PowerShell. All of them contain codes to launch IE from PowerShell as an object,

6条回答
  •  爱一瞬间的悲伤
    2020-12-06 07:21

    There's HKCU\Software\Microsoft\Internet Explorer\Main\FrameMerging registry key that prevents merging IE "frame" processes, explained here. I haven't tried it myself, but I think it might solve your problem if you set it before you instantiate the InternetExplorer.Application COM object.

    If that doesn't help, try launching a new IE instance with the following command line, prior to creating the COM object (I haven't tried that, either):

    • iexplore.exe -noframemerging -private -embedding

    There is a possible race condition before this IE instance becomes available as a COM server, so you may want to put some delay before you create an object.

提交回复
热议问题