我正在寻找一种方法来检索从由运行时创建的对象的进程ID:闭幕通过WScript.CreateObject
Set ie = WScript.CreateObject("InternetExplorer.Application", "ie_")
我的问题是,有时我看到iexplorer
进程是开放并运行后未关闭:
ie.stop
ie.Quit
我找到了一些解决方法,就像寻找最新iexplorer
过程或看进程名,但是这是不好的我,因为我有几个互联网资源管理器实例打开通过不同的过程并行,它可能在同一时间。
这是不好:
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where " _
& "Name = '"& sProcessName & "'")
我看到this solution可能的工作,但我不知道如何实现它的Internet Explorer。
非常好。有时我看到导航功能会在“常规”Internet Explorer中打开我的网站,而不是由Application.internetexplorer创建的窗口。它发生在我用“_self”标志呼叫时... 你能想到一个原因吗?在这种情况下,杀死将不会帮助 – fredy 2012-04-19 16:44:47
顺便说一下,我使用了Powershell的命令 – fredy 2012-04-19 16:46:27