1.

Solve : telnet script?

Answer»

Hi
I am writing a simple batch file which will telnet to a server. I want to check the authentication status i.e., has user typed the correct username & password OR typed some control characters like ctrl-C,ctrl-D. Because based on the status I need to do some other business in the batch file.

Is it possible to suppress ctrl-C and ctrl-D while doing telnet so that the user can't ESCAPE the telnet authentication.

I hope U understand my problem. Thanx in advance.windows telnet has limited scripting COMPONENTS..what do you want to do after you authenticate? do u need to execute some remote commands? or is it just to provide an validation mechanism ?It is just to provide a validationQuote

It is just to provide a validation
like i said, windows telnet lack scripting components.you can either USE vbscript or programming LANGUAGES that have telnet scripting libraries, eg perl,python. Anyother way is to get those telnet clients that provide scripting components...
simple example of using perl telnet module
Code: [Select] use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/bash\$ $/');
$t->open("remoteserver");
$t->login($username, $passwd) or DIE "Cannot login. Check login and password";




Discussion

No Comment Found