ゆとぶ - 片上裕翔のブログ

片上裕翔 - 日本と海外を比べてみよう

メインのテーマは英語。日本(日本人)と海外(外国人)の違いや英語の勉強方法について、これまでの経験から感じた事を記事にしています。

スポンサードリンク

英語化企画:Create a batch file to automatically open several websites

Hello this is Yuto.

今回の英語化企画は以下の記事が対象です。

blog.yutokatagami.com

Do you open the same websites everytime you sit at your computer? Do you start off your day by visiting the same websites? Wouldn't it be convenient if all the websites openned up for you automatically?

Well, the easiest thing you can do is create to a batch file on your desktop.

Creating this batch file icon is easy. ANYONE can do it.

Lets take a look

Its always hard to describe these things by word so lets quickly run this through.

This is what the batch file you will create will look like. Just an icon on your desktop (or in any folder you wish).

f:id:YutoKatagami:20160426001653p:plain

Open the batch file and a new internet explorer will appear with all the sites you specified.

f:id:YutoKatagami:20160426001904p:plain

You can create several batch files if you have multiple sets of websites you wish to group together.

How to make this icon

As i mentioned, making this icon is easy. Here are the steps.

  1. Open notepad and paste the following script.
    start iexplore.exe -new http://www.gmail.com
    timeout 3 /nobreak && echo
    start http://blog.yutokatagami.com/
    start http://google.com
  2. change the URL part in the script above to the url of the page you want to open. Incase there are more than 3 sites, all you have to do is keep adding a line with "start <URL>" just like the image below.

    f:id:YutoKatagami:20160426010045p:plain

  3. Click on "File" - "Save as" from the menu

    f:id:YutoKatagami:20160426010115p:plain

  4. Add ".bat" to the end of your file name and change the file type to "all files." The file name it self doesnt matter.

    For example if you want to name your file "OpenShortcuts" then here is what you will specify.

      FileName: OpenShortcuts.bat
      FileType: All files

    f:id:YutoKatagami:20160426010133p:plain

This is all you have to do. Double click on the batch file you just made and verify that the pages you have specified opens.

To Modify: [RightClick] - [Edit]

To modify the file, right click on the icon and select edit. This will open your script in notepad. Make your modifications and overwrite the file.

f:id:YutoKatagami:20160426010443p:plain

 

Explanation: Here is how it works

The file you made is called a batch file. (hence the file ending with a .bat extension)

1. start iexplore.exe -new http://www.gmail.com
2. timeout 3 /nobreak && echo
3. start http://blog.yutokatagami.com/
4. start http://google.com

Each line is executed in order. line 1, 3, and 4 is the command to open up a new page. line 2 pauses the script for 3 seconds.

 

You will notice that the first line begins with "start iexplorer.exe -new" while line 3 and 4 begins with only a "start." This is because we want to open the first site in a new internet explorer window. The iexplorer.exe (internet explorer) process takes in "-new" as a parameter, which specifies that we want to create a new window.

We need to allow it few seconds for the initialization to complete when we open a new internet explorer window. This is the purpose of our second line. The timeout command pauses the script for 3 seconds.

If you computer is fast enough, an 1 second timeout may be enough. On the otherhand, if your computer is slow and the script isnt working for you, you may want to extend the timeout.

The GUI way of doing this

You can do something similar without using a batch file.

To do this:
   1. open Internet Explorer
   2. Open Internet Options from [Tools] Menu - [Internet Options]
   3. Specify your URL in the homepage section.

f:id:YutoKatagami:20160426011317p:plain

The URL you specify here will be openned EVERY time you open interenet explorer, even when you dont want it.

The reason i recommeded using a batch file is because of its flexibility. You can click on the batch file when you want to open the set of sites, or you can open IE normally to browse the web. You can also create several batch files if you have several sets of websites you want to group together.

Hope this article helps.