How can I create a RAS Connection Script?

John Savill

March 4, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. A. It is possible to write a script that will run when you connect during a RAS connection to automate actions such as entering your username and password. To specify a script perform the following

  1. Double click on My Computer and start up the Dial-up Networking applet

  2. Select the phonebook entry and click More.

  3. From the More menu select "Edit entry and modem properties"

  4. Click the Script tab and select "Run this script"

  5. Click the "Edit script..." button and the SWITCH.INF file will be opened

  6. Go to the bottom of the file and create a new connection section and then select exit

  7. Answer Yes to save changes

  8. Click the "Refresh List" button and the new entry will now be displayed.

  9. Select the new entry you created and click OK.

An example addition to the SWITCH.INF would be

; the phonebook entry
[Savill1]
; send initial carriage return
COMMAND=
; wait for : (after username, may be different at your site) omit the U as it may be capitals. You could just have :
OK="sername:"
LOOP=
; send username as entered in the connection dialog box, alternaticly you could just enter the username e.g. savillj
COMMAND=
; wait for : (after password this time, may be different at your site)
OK="assword:"
LOOP=
; send the password entered in the connection dialog box, again you could just manually enter the password, e.g. password
COMMAND=
NoResponse
; send the "start ppp" command
COMMAND=ppp default
OK=

In depth information on all of the commands can be found in the SWITCH.INF file.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like