Luis Diaz
asked on
Windows Batch: open multiple url tabs based on txt file
Hello experts,
I have the following bat file which allows me to open automatically multiple tabs.
I would like to add the following requirement:
Instead of reporting url I would like to loop a url.txt which contains the various urls.
Error checking:
If url.txt file doesn’t exists
I have the following bat file which allows me to open automatically multiple tabs.
I would like to add the following requirement:
@echo off
SET BROWSER=chrome.exe
SET WAIT_TIME=2
START %BROWSER% -new-tab "url"
START %BROWSER% -new-tab "url2”"
Instead of reporting url I would like to loop a url.txt which contains the various urls.
Error checking:
If url.txt file doesn’t exists
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use any valid file name.
»bp
»bp
That is you just add the path to the variable:
SET URL_LIST=C:\Test\url.txt
ASKER
Noted. Unable to test it right now. I will test it as soon as I can.
ASKER
Tested and it works! Thank you very much for your help.
I have a question, if I want to add a comment in url.txt file in front of url which string or character should I use.
Example
Thank you again for your help.
I have a question, if I want to add a comment in url.txt file in front of url which string or character should I use.
Example
http://url "comment"
http://url2 "comment2
Thank you again for your help.
The way it is set up currently you can't. It takes the whole line as the URL.
If you wanted you could select a character as the comment start and ignore anything after that (space, pipe, semi colon, etc). Then a small change to the FOR /F loop would be needed to accommodate that.
»bp
If you wanted you could select a character as the comment start and ignore anything after that (space, pipe, semi colon, etc). Then a small change to the FOR /F loop would be needed to accommodate that.
»bp
ASKER
Ok, In that cas what I will do is to comment directly through rem in the bat file. Thank you again for your help. Bill!
Welcome.
ASKER