These notes apply only to RAS on Windows NT, 2000, and XP.

Use the AT command to schedule Dial-Up Network connections (or
any other schedulable events) for a specific time:

C:\Tmp> at /?

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled
                   on the local computer if this parameter is omitted.

id                 Is an identification number assigned to a scheduled
                   command.

/delete            Cancels a scheduled command. If id is omitted, all
                   the scheduled commands on the computer are canceled.

/yes               Used with cancel all jobs command when no further
                   confirmation is desired.

time               Specifies the time when command is to run.

/interactive       Allows the job to interact with the desktop of the
                   user who is logged on at the time the job runs.

/every:date[,...]  Runs the command on each specified day(s) of the
                   week or month. If date is omitted, the current day of the
                   month is assumed.

/next:date[,...]   Runs the specified command on the next occurrence
                   of the day (for example, next Thursday).  If date is
                   omitted, the current day of the month is assumed.

"command"          Is the Windows NT command, or batch program to be run.


For making a Dial-Up Network Connection:

C:\Tmp> rasdial /?

USAGE:
        rasdial entryname [username [password|*]] [/DOMAIN:domain]
                [/PHONE:phonenumber] [/CALLBACK:callbacknumber]
                [/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]

        rasdial [entryname] /DISCONNECT

        rasdial

Command completed successfully.

-----

These commands are the basis for making automated Dial-Up Networking
connections.  Unfortunately, there is no good way to ask "do I have a valid
connection?" or "am I already connected to <entryname>?".

The tools we do have are:

 . ask K95 to SET HOST and check the for success or failure

 . RASDIAL <entryname> - if already connected, the port will be in use
   and the command will fail with Error 633.  However, the port could
   be in use for any reason and it will also fail with Error 633.
   Note that RASDIAL might not be in your PATH, so you might have to
   type its full pathname, e.g. in Windows XP "c:\i386\rasdial.exe".

   C:\Tmp> rasdial powerpc1
   Connecting to POWERPC1...

   Remote Access error 633 - The port is already in use or is not
   configured for Remote Access dial out.

   For more help on this error:
        Type 'winhlp32 rasphone.hlp'
        In help, choose Index page and type 'Error 633'

 . RASDIAL by itself.  Will report to the screen the current
   connection status.

   C:\Tmp> rasdial
   Connected to
   PowerPC1
   Command completed successfully.

   C:\Tmp> rasdial
   No connections
   Command completed successfully.

   However, it does not indicate it at all by the exit status.

---

So the best we can do is the following:

SET HOST <host>
IF FAILURE {
    RUN RASDIAL <entryname>
    XIF SUCCESS {
	DEFINE RASCONNECT YES
	SET HOST <host>
    }
}

... conduct your session ...

CLOSE
IF DEF RASCONNECT {
    RUN RASDIAL <entryname> /DISCONNECT
    UNDEFINE RASCONNECT
}

Unfortunately, it is not possible for Kermit to automate the dialing
process or the creation of the RAS phone book entries.

(End)