Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
A question to BAT-gurus!
First of all, I am not a programmer, so please don't blame my ignorance.
Every morning I come to office and open my Internet Explorer to see what happened last day. I am pretty tired to type in an url, then open a new window, type another url, and so on.
I know BAT files can help automate routine tasks, and that they are plain text files containing lines of commands.
But, WHAT commands I should insert into the file, I don't know, so any help is appreciated.Example:
I want, by clicking on a SINGLE button, to open Internet Explorer, and then open, let's say, the following windows:
1) www.cbsnews.com
2) www.google.com
3) www.cnn.com
4) www.bbc.co.ukWhat should I type in the BAT file to make the system do these tasks for me?
Also, if someone can provide a good link for BAT-related information resources for novices, I'd appreciate that as well.
Thanks,
rturro

forget batch files, do this:
Make an html file (this can be done in wordpad) that looks like this:
<html>
<script language="JavaScript">
function OpenURLs()
{
window.open('www.cbsnews.com','','');
window.open('www.google.com','','');
window.open('www.cnn.com','','');
window.open('www.bbc.co.uk','','');
}
</script>
<body>
<input typy="button" onclick="JavaScript:OpenURLs();">
</body>
</html>
then go to tools/internet options and set your home page to be this file (whatever you named it)then click on that button.

Thanks, and sorry it does not work :-(
Ok, I created a file "news.html" with the text you gave me, and saved it on my Desktop.
Now I click on it, it opens IE with a button that I'm supposed to click.
I click the button, and here is what happens:
IE opens four windows (by the number of websites) but does NOT go to the respective websites. For instance, for the window with www.bbc.co.uk it looks like this:
"C:\WINNT\Profiles\My profile name\Desktop\www.bbc.co.uk
IE says it can't find the page.Could it be because I have JavaScript disabled on my machine (or prohibited by security settings)? FYI, I am trying this out on my office machine, which is NT 4.0, strictly configured by the SA.

The opening lines should read...
window.open("http://www.cnn.com",'','');
I had the same problem when I pasted the code... Replace the ' with " on the link.
Infinite Recursion

window.open("http://www.cnn.com",' ',' ');
There, that's a bit more clear... keep the single quotes used in the last two parameters. Just double quote the url you want to go to.
Infinite Recursion

=============================================================
Let's just simplify it to what you originally asked for:open notepad and type the following lines...
@echo off
iexplore www.cbsnews.com
iexplore www.google.com
iexplore www.cnn.com
iexplore www.bbc.co.uksave this file as websites.bat in the same directory (folder) as iexplore.exe. The location of iexplore is different with different versions of windows so you may just want to do a search for iexplore.exe to find its actual location. Create a shortcut on your desktop to the file websites.bat and you should be off and running.
borelli34

That's it!
Infinite Recursion, thanks for clarifications, it works now! (provided that you type in the complete URL, including "http://" - otherwise it does not work).
borelli34: thank you very much, but there is this problem - when I execute your bat file, IE wouldn't open the new windows until after I've closed the previous one. There must be some kind of workaround to it (a switch or something...).
Anyway, thanks to everybody, I am now a happy and calm person!
Best regards,
rturro

To get that batch file to work, you need to change a setting in IE to prevent it from reusing windows to launch shortcuts.
Just go to the Tools menu > Internet Options > Advanced Tab.
Now under the 'Browsing' section, uncheck the box that's labeled 'Reuse windows for launching shortcuts'.
Now that batch file should work, though the HTML file is probably a better solution.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |