You can automate the connection process for any Microsoft client by using a simple batch file and the rasdial command. The rasdial command starts a network connection by using a specified entry.


rasdial connectionname [username [password | *]] [/domain:domain] [/phone:phonenumber] [/callback:callbacknumber] [/phonebook:phonebookpath] [/prefixsuffix]

The rasdial command disconnects a network connection by using the following syntax:

rasdial [connectionname] /disconnect 


None : Used without options, rasdial displays the status of current connections.

connectionname   : Specifies an entry in the current .pbk file, located in the systemroot\System32\Ras folder. If the connection name contains spaces or special characters, enclose the connection name in quotation marks (").

The Rasphone.pbk file is used unless the Personal Phonebook option is selected. If the Personal Phonebook option is selected, the file username.pbk is used. The name is shown on the Rasphone title bar when Personal Phonebook/p is selected. Numbers are appended if name conflicts occur.

username [ password | * ] : Specifies a user name and password with which to connect. If an asterisk is used, the user is prompted for the password, but does not display the characters typed.

/domain: domain   : Specifies the domain the user account is located in.

If not present, the last value of the Domain field in the Connect To dialog box is used.

/phone: phonenumber   : Substitutes the specified phone number for the entry's phone number in Rasphone.pbk.

/callback: callbacknumber   : Substitutes the specified callback number for the entry's callback number in Rasphone.pbk.

/disconnect   : Disconnects the specified entry.

/phonebook : phonebookpath   : Specifies the path to the phonebook file. The default is systemroot\System32\Ras\username.pbk. You can specify a full path to the file.

/prefixsuffix   : Applies the current TAPI location dialing settings to the phone number. These settings are configured in Telephony, which is located in Control Panel. This option is off by default.

Rasdial examples

To connect to the OFFICE entry in Rasphone.pbk, type:

rasdial office

To connect to the OFFICE 2 entry in Rasphone.pbk and specify a callback number, type:

rasdial "office 2" /callback:555-0100

To disconnect from the EAST OFFICE entry, type:

rasdial "EAST OFFICE" /d



The following Rasphone.exe features are not supported with rasdial:

  • Entries that require Terminal mode user entry during the dial sequence.

  • Operator-assisted or manual dialing.