开发者

How can I open a list of URLs on Windows

开发者 https://www.devze.com 2023-02-26 05:45 出处:网络
I\'m looking for a way to open a list of URLs in all of my browsers ( Firefox, Chrome, and IE ) on Windows using a scriptable shell such as Powershell or Cygwin.

I'm looking for a way to open a list of URLs in all of my browsers ( Firefox, Chrome, and IE ) on Windows using a scriptable shell such as Powershell or Cygwin.

Ideally I should be able to type in a list of URLs开发者_JS百科 as arguments to the command, i.e. `openUrl http://example.net http://example2.net http://example3.com...

I would also need this script to pass authentication info into the http header (encoded usename and password).


With chrome it's not hard.

$chrome = (gi ~\AppData\Local\Google\Chrome\Application\chrome.exe ).FullName
$urls = "stackoverflow.com","slate.com"
$urls | % { & $chrome $_ }


First, how to open URLs in PowerShell. In PowerShell open a URL is very simple, just use start

start http://your.url.com

I think you can simple use foreach to handle the list of URLs.

Second, pass authentication via URL. There is a standard way for HTTP based authentication. (not HTML form based). You could construct the URL like:

http://username:password@your.url.com 

Again, it only works for HTTP based authentication.


Look at HKCR\http\shell\open\command how each browser handles urls. Then just use the normal methods to launch the browsers with appropriate urls.

0

精彩评论

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