Every time you dial-in to your ISP, do you wait for the
terminal window to come up, type in your username and password, and wait for the
system to authenticate you? Well, there’s an easier way to do this, by letting
the system authenticate you to the ISP. Not only is the PC faster in
"typing" the name and password, you can also automate a lot of other
tasks due to this feature.
Most dial-up ISPs use PPP (Point-to-Point Protocol) to let
you use their services. The authentication can happen in many different ways–basic
authentication, CHAP or other methods. We shall be covering the basic
authentication method here, as that’s what most ISPs use. (MTNL uses CHAP,
which doesn’t require these steps.)
Windows 9x and NT both have an option of setting up scripts
to automate the login process. These, however, are not very intuitive and easy
to set up, and are not much used. Windows 2000, on the other hand, comes with a
new kind of script (more like an INF or INI file actually) that’s easy to set
up and get running. I’ll quickly walk you through the steps to set up a script
and a few options that you can experiment with.
The first thing to do is to set up a new ISP dial-in account,
if you haven’t done so already. I assume you are using Windows 2000
Professional or Server. Open the "Network and Dial-Up connections"
folder in Control Panel. Run the "Make New Connection" icon here. (As
a shortcut, if you’ve turned on the "Expand Network and Dial-up
Connections" option in the Taskbar> Advanced Properties, you can select
this directly from Start>Settings>Network and Dial-up Connections>Make
New Connection.)
Click "Next" to start the wizard.
Now choose the "Dial-up to the Internet" option and
continue. This should open the Internet Connections Wizard.
Choose "I want to set up my Internet connection
manually".
Choose "I connect through a phone line and modem"
in the next screen.
Enter your area code, the country and the number of your ISP.
You can deselect the user area code and dialing rules if the ISP is in the same
city (that is, you don’t make STD calls to get connected).
Continue and give your login name and password here.
Next, give the connection a descriptive name.
Select "No" for setting up a mail account and
deselect the "Connect to the Internet immediately…" check box and
press Finish. You should now have a new entry in the network folder that lets
you connect to the Net through your ISP.
Now you need to set up the script that does auto login.
Browse your hard disk and go to the WINNT\SYSTEM32\RAS folder. Look for the file
SWITCH.INF and take a backup of it somewhere. Now open your newly created
dial-up entry, but don’t click "Dial" yet.
Instead, click "Properties" and select the
"Security" tab. Select the "Run Script" option, choose
"Generic Login" from the dropdown box next to it, and click the
"Edit" Button. This will open up the SWITCH.INF file in Notepad.
Scroll down till you come to the line that says
example "My Favorite ISP". All lines with a semicolon (;) at the
beginning are comments and can be safely ignored. Scroll down till you come
across the line that says, COMMAND=. Add a "
this line, without the quotes, to make the line look like this: COMMAND =
This command basically sends a carriage return to the remote server to initiate
a data session.
Now look at the next uncommented line: OK=
This line identifies the text that the local script is to wait for before doing
anything else. In this case, it’s the string that asks the user for his login
name. The script waits for "ogin:" instead of "Login:" as
the server may send both "login:" as well as "Login:". Only
the common part is used here to avoid errors. However, if your ISP uses a
different string, change this part accordingly. For example, my ISP uses
"Username:" so I changed the above line to read:
OK=
part of the string.
The next line: LOOP=
ignores all incoming text, till it gets the above string. These two lines
together ensure that the script continues to the next step only when the
specified string is found in the incoming text.
Once the text is received, the script reaches the next step.
Here the line COMMAND=
name you entered, in the dial-up entry box and appends an enter-key press after
it. The remaining part of the script follows the same login for the password.
You can change the text for the password according to what your ISP sends.
Once these changes are made, save the file and make sure that
the "Run Script" box is on and the "Show Terminal Window"
box is off. Save the settings and dial out. The script will automatically log
you in.
The SWITCH.INF is a quick way of setting up a login script.
However, the simplicity belies the power it wields. Each script consists of a
section header, commands, and macros that you can use. Commands like OK, COMMAND
and LOOP combined with macros like
Win 9x/NT script language would do only by writing a few lines of code.
If you’d like to take a look at all the different commands
and macros available, open the file NETCFG.CHM in the WINNT\HELP folder. Use
this technique to become a quick connector and power Net user.
Vinod Unny is a technology consultant at iSquare Technologies