我正在尋找一種方法來檢索從由運行時創建的對象的進程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