Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I open a list of URLs on Windows

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 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).

like image 315
jrdmcgr Avatar asked Apr 14 '11 19:04

jrdmcgr


3 Answers

With chrome it's not hard.

$chrome = (gi ~\AppData\Local\Google\Chrome\Application\chrome.exe ).FullName
$urls = "stackoverflow.com","slate.com"
$urls | % { & $chrome $_ }
like image 75
Scott Weinstein Avatar answered Sep 21 '22 21:09

Scott Weinstein


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:[email protected] 

Again, it only works for HTTP based authentication.

like image 38
Yi Zhao Avatar answered Sep 24 '22 21:09

Yi Zhao


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.

like image 34
data Avatar answered Sep 25 '22 21:09

data