Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

Open all links in the txt file in 1 window

Hi,

I want a script which can open all pages in a txt file.Say i have 50 addresses web links (Http:\\sitename)
I want a way to open all these 50 links in a ie 7.0 Ie.Any way to open all at a time in a tab sheet not a new window..

Regards
Sharath
0
bsharath
Asked:
bsharath
1 Solution
 
bpreissCommented:
Hello Sharath,

A VB Script could help out on that.

Assuming your URL/Link file looks the file below, and we name it UrlList.txt:

/* ---------------------------
/* URL's with parameter
/* ---------------------------
http://www.google.com/search?hl=en&q=expert+exchange+stop+code+0x0000007B&btnG=Search
http://www.amazon.com/s/ref=dp_srsubj_entry/105-2317234-9541264?ie=UTF8&index=books&field-keywords=Software%20engineering
http://www.dell.com/content/products/productdetails.aspx/xpsnb_m1730?c=us&cs=19&l=en&s=dhs&~tab=bundlestab

/* --------------------
/* Plain URL's
/* --------------------
www.google.com
www.cnn.com
http://dogpile.com

the following few lines in a vbs file would open each of the links into a new tab within the same IE7 window.
'-----------------------------------
'*** Begin of StartURL.vbs
'-----------------------------------
Dim objFSO, objFile
Dim objShell
Dim Stream
' Refer to the file name with URL
Const URLFile = "C:\UrlList.txt"

Set objShell = CreateObject("Shell.Application")

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(URLFile) Then
    Set objFile = objFSO.OpenTextFile(URLFile, 1)
    Do While Not objFile.AtEndOfStream
           Stream = Trim(objFile.ReadLine)
           If Len(Stream) > 5 AND Left(Stream,2) <> "/*" Then
               objShell.ShellExecute Stream, "", "", "open", 1
               'objShell.ShellExecute(0&, "open", Stream, "", "", 1)
           End If
      Loop
      objFile.Close
End If
'-----------------------------------
'*** End of StartURL.vbs
'-----------------------------------

Best Regards,
Bernhard
Set objShell = Nothing
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now