开发者

PowerShell, Object = Start Process?

Hi I would like to start the Internet 开发者_StackOverflowExplorer 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()
  • }


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜