Script to automate URL opening in multiple tabs in Firefox or Opera from a text file

后端 未结 4 1809
旧巷少年郎
旧巷少年郎 2021-01-07 13:59

I have a text file with lots of links-each line has a link (i.e the separator is \'\\n\'). i want to write a script so that each link opens in a different tab in Firefox or

4条回答
  •  情话喂你
    2021-01-07 14:40

    The solution that worked for me is:

    set "fileList="
    FOR /F "usebackq delims=," %%i IN ("C:\Documents and Settings\xwell\Desktop\urls.txt") DO (
    start %%i
    )
    

    Four changes I made:

    1. I set the delimiter to a comma - delims=,
    2. Put a comma between each URL in my text file
    3. And put the for loop function in brackets
    4. Changed the start function. This uses the default browser, though you could specify it as per the above example

    So, the text file urls.txt looks like:

    http://www.rte.ie,
    http://www.python.org,
    http://www.bbc.co.uk,
    http://www.google.com
    

提交回复
热议问题