Sunday, November 7, 2010

Scheduling BSNL Broadband for Night Downloads

Here are two batch scripts which are used to connect or disconnect your broadband connection. These scripts can also be scheduled at a particular time so that you connect to broadband only when you require. A must have for people who are using limited plans which give unlimited downloads in night hours. Note that this will work in Bridge mode only, so first configure your modem in bridge mode and then try this method.

Batch File for Connecting BSNL Broadband :
Windows has a command to dial up your connection. Using the command ‘rasdial’
here is the code which assumes that the name of connection you made is “BSNL”
 rasdial BSNL username password
So if your user name is ‘Tommy’ and password is ‘doggy’’ then the script will be
rasdial BSNL Tommy doggy
Now copy the above code and paste it into notepad. When you save the file click “save as” and in the file name write “connect.bat” including double quotes. The double quote will ensure that the file type is “bat” and not “txt” as happens with any file you save with notepad. The file icon should look like this figure.


Batch File for Disconnecting BSNL Broadband :
Simply add /disconnect to the above batch file as follows-
rasdial BSNL /disconnect
Save this file as ‘disconnect.bat’
Make a new folder in C:/ drive and keep these batch files in the folder

Scheduling Automatic Connection Using These Batch Files :
Here we can schedule automatic connection to broadband using the inbuilt Windows Task Scheduler. Here is how to do it.
  1. Open control panel=>Scheduled Task. Add scheduled Task. This will open ‘Scheduled Task Wizard’. Here you will see a list of programs which you can schedule. Click ‘Browse’ and go to the folder where you saved ‘connect.bat’ and select it.
  2. Give the task, a name say, connect1 and set the frequency say ‘daily’ and click next.
  3. Select the start time and start date. Start date will be today and set the start time to the time you get unlimited downloads. For BSNL set it to 02.10 am.
  4. In the next step it will ask for your computer user name and password. If you have  single user computer, this field will be filled already ,so click next.
  5. Tick ‘Open advanced properties for task when I click finish’ and click next.
You should see the window as follows-

Remember to tick ‘Run only if logged on’ and press OK. Now when you open control panel=>scheduled task, you should see you task listed there.
Similarly add “disconnect.bat” and schedule it at 07.50 am.
Finally you should see your scheduled task windows as the following figure.
Here I have scheduled “connect.bat” three times as sometimes the connection fails in my region.

Now just put your modem in ON condition and sleep peacefully. Your modem will automatically connect to broadband at the time you want and disconnect too at required time.

No comments:

Post a Comment