|
Answer» Hi
Hi ALL I need HELP regarding a batch file through which I telnet and run some application if telnet is successful.
Thankx in advance.windows telnet have limited facility for scripting. its either you download tools from internet that can do this, or write your own USING languages like perl, python,java , vbscript...etc. Thanks ghost
can U give me a sample perl script to do the same so that I can go through it.Google is your best friend.. type "Net::Telnet examples" in google. Go for the first result, it shows examples on how to use the moduleThankx ghost
I need to CLARIFY 2 more things
1. I am doing telnet thru the batch file and interactively typing the user name and password and I need to test the status code of telnet command then execcute another command if successful. How to achieve this? I will write the algorithm below: telnet if telnet is SUCCESSFUL execute command else EXIT
2. Is it possibe to trap ctrl-D character in batch file.Quote Thankx ghost
I need to clarify 2 more things
1. I am doing telnet thru the batch file and interactively typing the user name and password and I need to test the status code of telnet command then execcute another command if successful. How to achieve this? I will write the algorithm below: telnet <hostname> if telnet is SUCCESSFUL execute command else EXIT
2. Is it possibe to trap ctrl-D character in batch file.
1) don't get you. A batch file's purpose is for automation. If you want to do it interactively, just open a command prompt and type telnet will do. And, by doing interactive, your eyes will do the error checking WHETHER its succesful...right? 2) it is BEYOND simple batch to catch keyboard characters, AFAIK. Maybe some assembly code and feeding these code into debug can do the trick..but it's out of scope for me..
|