Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: catching control characters  (Read 5107 times)

0 Members and 1 Guest are viewing this topic.

abc

  • Guest
catching control characters
« on: June 27, 2006, 08:11:32 AM »
HI

Is it possible to catch the control characters like ctrl-D or ctrl-C in the batch file.

Thanx

ghostdog74



    Specialist

    Thanked: 27
    Re: catching control characters
    « Reply #1 on: June 27, 2006, 08:47:52 AM »
    give an example of what you wanna do...

    abc

    • Guest
    Re: catching control characters
    « Reply #2 on: June 27, 2006, 09:23:39 AM »
    1.     I need to do telnet in a batch file just for validation and invoke some 'X' application

    2.     I can't use languages like perl/vbscript/python/java,  except DOS batch script

    3.     while doing telnet in the batch file if the user types ctrl-D, it is coming out from the telnet session and
            proceeding further. So, if I can suppress(unset) ctrl-D then user can't escape the telnet authentication.

    4.     User  to successfully login to the telnet session then only he can proceed further in the batch file.

    5.     EXAMPLE:

                @ECHO OFF
                telnet  <host name>
                ECHO %ERRORLEVEL%
                pause
                <invoke some X application>
                ...
            Actually I am a UNIX guy, I am not familiar with DOS. Please suggest me some ideas keeping in view of my
            limited resources.
    Thankx
                

    ghostdog74



      Specialist

      Thanked: 27
      Re: catching control characters
      « Reply #3 on: June 27, 2006, 10:44:17 AM »
      Quote
      1.     I need to do telnet in a batch file just for validation and invoke some 'X' application

      2.     I can't use languages like perl/vbscript/python/java,  except DOS batch script

      3.     while doing telnet in the batch file if the user types ctrl-D, it is coming out from the telnet session and
              proceeding further. So, if I can suppress(unset) ctrl-D then user can't escape the telnet authentication.

      4.     User  to successfully login to the telnet session then only he can proceed further in the batch file.

      5.     EXAMPLE:

                  @ECHO OFF
                  telnet  <host name>
                  ECHO %ERRORLEVEL%
                  pause
                  <invoke some X application>
                  ...
              Actually I am a UNIX guy, I am not familiar with DOS. Please suggest me some ideas keeping in view of my
              limited resources.
      Thankx
                  


      1) when you say invoke 'X' application, is 'X' at remote or local?
      2) how restricted are you? you can't run WSH/CSRIPT (vbscript) even?
      3) u can try setting your batch to telnet to server using automatic login (-a) or (-l)
          eg telnet -a host , or telnet -l username host
          If all else fails, you can try ftp login using the -s option , if the user has supplied the correct credential and password, he can continue.

                  
          

      abc

      • Guest
      Re: catching control characters
      « Reply #4 on: June 28, 2006, 01:21:51 AM »
      Thanks ghost

           I can use wsh/cscript. Could U provide me a working example. Inside the script, I just telnet to a Unix server and exit from the telnet session and invoke some 'X' application which is a local one NOT a remote one.

           The reason for telnetting is just to validate the Unix login. If his password expires, it will force and he can change the password at regular intervals.

      ThankX again for ur prompt response.

      ghostdog74



        Specialist

        Thanked: 27
        Re: catching control characters
        « Reply #5 on: June 28, 2006, 03:34:02 AM »
        don't know whether it works. you can try it out
        http://sourceforge.net/projects/telscript/