我想使用隐身/私有(private)模式打开一个带有 IE、CH 和 FF 的 URL。
我可以使用以下 Powershell 脚本使用 3 个浏览器打开 url:
Param(
[string] $url
)
[System.Diagnostics.Process]::Start("chrome.exe", $url)
[System.Diagnostics.Process]::Start("firefox.exe",$url )
$IE=new-object -com internetexplorer.application
$IE.navigate2($url)
$IE.visible=$true
如何以隐身模式打开浏览器?
最佳答案
chrome.exe
需要 --incognito
命令行选项:
[System.Diagnostics.Process]::Start("chrome.exe","--incognito $url")
同样,
firefox.exe
需要 -private-window
命令行选项:[System.Diagnostics.Process]::Start("firefox.exe","-private-window $url")
正如@TToni 在评论中所指出的,对于
iexplore.exe
相当于-private
:[System.Diagnostics.Process]::Start("iexplore.exe","$url -private")
InternetExplorer.Application
com 对象不支持 InPrivate 浏览 AFAIK
关于powershell - 通过 Powershell 以隐身/私有(private)模式打开多个浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38565707/