Dial-Up Connection Performing a Logon

Top  Previous  Next

 

In this example, a common sequence of performing a remote logon (being prompted for and sending a user ID and a password) in an async modem environment is shown.

 

DIAL "555-1212" /timeout=60

;; check for connection

IFERROR!= $ERROR_SUCCESS goto Exit

;; Accept a character string command from the remote system

;; (assuming that a prompt for a user name is expected)

;; (we don't really care what this string is)

LINEIN cmdvariable /flush /timeout=60

IFERROR= $ERROR_SUCCESS goto Operation2

GOTO Disconnect

:Operation2

;; Send a user name or ID string to the remote system

LINEOUT "username" /flush /timeout=60

IFERROR= $ERROR_SUCCESS goto Operation3

GOTO Disconnect

:Operation3

;; Accept a character string command from the remote system

;; (assuming that a prompt for a password is expected)

;; (we don't really care what this string is either)

LINEIN cmdvariable /flush /timeout=60

IFERROR= $ERROR_SUCCESS goto Operation4

GOTO Disconnect

:Operation4

;; Send a password string to the remote system

LINEOUT "password" /flush /timeout=60

IFERROR= $ERROR_SUCCESS goto Operation5

GOTO Disconnect

:Operation5

;; here the script might send or receive a file

;; or perform other required operations

. . .

:Disconnect

DISCONNECT

:Exit

EXIT