Saturday, July 28, 2012

All-in-one: Automate (scheduled) connecting modem, redial when lost, disconnect when done and shutdown your PC.

UPDATE: We replaced the app to shutdown to just write some command to shutdown, therefore you need no downloaded app.
 
In case there is a promotion from your phone carrier for a free internet connection at midnight, you sure don’t want to waste, and sure enough you don’t want to stay awake for a full night too! We have the trick! You just leave your computer on, go to bed and let everything happens on its own and even shut down itself. You don’t need to be a geek to know this. It’s that easy!

What you will get:
Automatic modem dialing (timed)
Automatic redialing if connection is dropped
Automatic download (optional)
Automatic shutdown (timed)
 
What you need:
Modem (a mobile phone, a modem...)
PC (Windows one, Mac is out of the list)
Keyboard
Little time for reading.
 
What to download:
Auto Shutdown (Click to download)
Nothing to download
 
We assume you already used your modem for previous successful internet connection. In this tutorial, I demonstrate using Windows XP Professional, modem connection from my Sony Ericsson (don’t care, folks! Everything is almost the same for other configuration)

Steps to do:
 If you cannot see image clearly, please click on image to get its original resolution.

1 , We are now checking internet connection profile. “Start” and “Network Connections”
1
2, Look for your connection profile. In my case, it’s “Smart 3G”. Remember this name! (or you can copy it)
3, Right click on your connection profile and click “Properties”
Capture_2

4, Click “Options” tab

5, Change “Redial Attemps”. Because my connection is not stable, I need it to redial if dropped. “0” is for infinited. And check “Redial if line is dropped”. Click “OK”. This is to make sure it redial itself when connection drops. 
Capture_3

6, We are now setting up a batch file for connecting to internet.
Open notepad by typing Windows Logo and R simultaneously. Type “Notepad”. Write “rasdial Smart3G” (without quotation marks). Change Smart3G to your connection name as mention above.
Capture_4

7. Save it and name it “connect.bat”. It is important to include .bat in the name area.
Capture_5

8. We are creating a scheduled connection now. Click Start Menu, and “All Programs” then “Accessories” then “System Tools” and then “Scheduled Task”.

9. Open “Add scheduled task”
Capture_6
10. Click “Next” then, “Browse” and locate the file “connect.bat” you saved in step 7.
Capture_7

11. Name it as you like. I named this task “connect”. Choose the option that you want. In my case, I want to connect daily, so I click “Daily”. Click “Next” when done.

12. Set connection start time. Then click “Next”.

13. Enter and confirm the password if your PC account has password. Then click “Next”

14. Click “Done”.

By now, the connection is automated. In my case, it starts every day and at the time you set. If you want to cancel it, go to the Task Scheduler as in step 8 and delete the “connection” task (as we named it on step 11).
For me, I want uTorrent (torrent client) to run when having internet. I only leave it open in background. It will download automatically when there is connection. If you use Internet Download Manager, use Scheduler to plan download.

Now, we are creating a shutdown schedule (so that internet connection also disconnects).
15, Download “Auto Shutdown” and install it.

15, Open notepad by typing Windows Logo key and R simultaneously and write “notepad” and “OK”

16, Write “shutdown –f –s” (without quotation marks). 
–f is for forced shutdown. Any program running at the time of shut down will be forced to close. Delete –f if you want your PC to ask you to end task. (shutdown –s)
Capture_11

17, Save and name it “shutdown.bat” "down.cmd". It is important to add .bat .cmd to filename.
Capture_12

Now we are scheduling a task to execute shut down command.

18, Launch task scheduler as in step 8.

19, Open “Add a scheduled task”

20, Click Next, then “Browse” and locate for “down.cmd” (we did on step 15-17).

21, Click Next and choose the option and time you want to shutdown your PC.
 Done!

By the way, if you only want to disconnect modem and NOT shutting down, let start step 15 the other way.

15, Open “Notepad” by typing Windows Logo key and R simultaneously and type “notepad” and okay.

16, Type “rasdial /disconnect” (without punctuation marks)
Capture_9

17, Save and name it “disconnect.bat”. It is important to add .bat to its name.
Capture_10

We are now creating a task to disconnect the internet at given time.

18, Click Start Menu then All Programs, then Accessories, then System Tools, then “Schedule a task”.

19, Open “Add Scheduled Task”, click Next. Click “Browse” and then locate “disconnect.bat” (saved at step 17).

20, Choose option you like as we did in step 11 to step 14. This is to disconnect internet.
Done, at your given time, internet will disconnect.

Everything is done. Just leave your computer on, modem plugged, and go to bed. Everything is set.

I hope you enjoy my how-to.
 Any problem, please comment.