Telnet scripting batch file




















Improve this answer. Mukul Goel Mukul Goel 8, 5 5 gold badges 34 34 silver badges 73 73 bronze badges. Thanks for this. I'll see if I can get something like this working. JonathanRioux Please accept this answer.

Just be careful about the sleep time. You might end up with telnet asking for username and Appreciate this Helped me out on my current project.

What is the solution for this? Kikiwa 1, 2 2 gold badges 12 12 silver badges 19 19 bronze badges. JoBaxter JoBaxter 2 2 gold badges 12 12 silver badges 23 23 bronze badges.

Redirecting a telnetcmd. It appears to be ignored. I am using Windows 7 64bit. I don't WANT to use telnet but it is the only method available to connect to an archaic temperature monitoring device in our foundry. I am using the Microsoft telnet client, so it looks like a simple batch file is not an option. There are many telnet services that have not been replaced by SSH. Another method is to use netcat or nc, dependent upon which posix in the same format as vatine shows or you can create a text file that contains each command on it's own line.

I have found that some posix' telnets do not handle redirect correctly which is why I suggest netcat. ANd it works perfectly if you know the protocol implemented. For SSH etc, it might be tough unless you know how to do the handshake etc, but simple telnet works like a treat. Another way i tried, was using external process in java System. Check for the SendCommand tool. If you're interested I'll see if I can dig it up and post it someplace.

I like the example given by Active State using python. Here is the full link. I added the simple log in part from the link but you can get the gist of what you could do. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Creating a script for a Telnet session? Ask Question. Asked 12 years, 9 months ago.

Active 3 years, 11 months ago. Viewed k times. Improve this question. TrentCoder TrentCoder 1 1 gold badge 6 6 silver badges 11 11 bronze badges. Use python telnetlib module. SendKeys "password" Regards, Suresh Jaganathan. Hi, I got the script CreateObject "WScript. SendKeys"ls" Regards, Suresh Jaganathan. I created a script in notepad and saved it as a.

Shell" cloner. Sleep cloner. SendKeys"UserName" cloner. SendKeys"Password" cloner. SendKeys"reboot" cloner. SendKeys"exit" cloner. Thursday, October 31, PM. SendKeys"exit" Have a nice day. Sunday, December 22, PM. Usage telnetd. Thursday, July 24, AM. Hi, The script is very useful.

Thank you very much for this. Just one thing stopping me to achieve my goal - In place of 'Enter' I have to give command of 'Space' key. How to do this? What should I write? Monday, December 21, PM. I would like to login the username and password using the BAT file. Did you run what was posted? Can you post the console output. If telnet cannot accept input from the pipe, it may be possible to redirect input from a file, but it will be necessary to see the sequence telnet requests the input.

Of course telnet may only take the password from the keyboard in which case you will be SOL. Let us know. If the telnet userid and password are the same ones you use for Windows, try using the -a switch: Code: [Select]. It is possible with help of another executable called telnetd.

I have developed this executable to automate telnetd. Usage telnetd. This telnetlog.



0コメント

  • 1000 / 1000