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 Internet explorer. How can I do this? I'm on Windows 7
views:
51answers:
2
+1
A:
Create a text file called whatever.bat and put it on your desktop. edit the file and enter:
set "fileList="
FOR /F "usebackq delims==" %%i IN ("C:\Documents and Settings\mdevine\Desktop\urls.txt") DO call set "fileList=%%fileList%% %%i"
start firefox %fileList%
close and save
double click on it
Note: C:\Documents and Settings\mdevine\Desktop\urls.txt is a text file that contains the following:
http://www.rte.ie
http://www.python.org
http://www.bbc.co.uk
http://www.google.com
amadain
2010-10-01 08:52:07
@amadain: each line of the txt file has a link ..so the separator is not a space
iceman
2010-10-04 13:40:22
edited from previous answer. above should do what you want
amadain
2010-10-05 14:56:04
A:
@iceman, @amadain:
refining @amadains solution: the "line continuation character" in batch files is ^, so iceman should change his text files accordingly (add a ^ at the end of each line) and put "start firefox ^" at the beginning of the file . Don't know max length of command line string, though.
knb
2010-10-01 22:05:47