home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 May / APC452.ISO / netkit / crt / crt.exe / LOGIN4.CSF < prev    next >
Encoding:
Text File  |  1997-03-04  |  1015 b   |  51 lines

  1. // login4.csf - login script for CRT 2.0
  2.  
  3. loop:
  4.         /* wait up to 3 seconds for "ogin:".  If not
  5.          * there, second a <CR>
  6.         */
  7.         if ( ! expect( "ogin", 3 ) ) {
  8.                 send("\r");
  9.                 expect( "ogin:" );
  10.         }
  11.  
  12.         // send user name
  13.         send( "username\r" );
  14.  
  15.         expect( "assword:" );
  16.  
  17.         // prompt user for password
  18.         send( prompt() );
  19.         send( "\r" );
  20.  
  21.         if ( expect( "Login incorrect", 3 ) ) {
  22.                 goto loop;
  23.         }
  24.  
  25.     // run a command and wait for finished response from
  26.     // the remote host.
  27.     send("SQL query\r");
  28.  
  29.     // ShowWindow argument
  30.     //    1 - Restore
  31.         //    2 - Minimize
  32.         //    3 - Maximize
  33.     //
  34.     // minimize window
  35.     ShowWindow(2);
  36.  
  37.     expect("SQL finished");
  38.  
  39.     // restore the window
  40.  
  41.     ShowWindow(1);
  42.  
  43.     // display message box
  44.     MessageBox("SQL query completed");
  45.  
  46.     // disconnect from remote host
  47.     Disconnect();
  48.  
  49.     // Close the window
  50.     CloseWindow();
  51.