home *** CD-ROM | disk | FTP | other *** search
- // login4.csf - login script for CRT 2.0
-
- loop:
- /* wait up to 3 seconds for "ogin:". If not
- * there, second a <CR>
- */
- if ( ! expect( "ogin", 3 ) ) {
- send("\r");
- expect( "ogin:" );
- }
-
- // send user name
- send( "username\r" );
-
- expect( "assword:" );
-
- // prompt user for password
- send( prompt() );
- send( "\r" );
-
- if ( expect( "Login incorrect", 3 ) ) {
- goto loop;
- }
-
- // run a command and wait for finished response from
- // the remote host.
- send("SQL query\r");
-
- // ShowWindow argument
- // 1 - Restore
- // 2 - Minimize
- // 3 - Maximize
- //
- // minimize window
- ShowWindow(2);
-
- expect("SQL finished");
-
- // restore the window
-
- ShowWindow(1);
-
- // display message box
- MessageBox("SQL query completed");
-
- // disconnect from remote host
- Disconnect();
-
- // Close the window
- CloseWindow();
-