could anybody help with dos commands for this task

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: could anybody help with dos commands for this task

#16 Post by Ed Dyreen » 07 Feb 2019 18:10

Squashman wrote:
02 Feb 2019 11:41
If you are trying to automate a telnet connection I would advise you to use Albert Yale's Telnet scripting tool.

http://support.moonpoint.com/downloads/ ... /tst10.php
With it, you can do something like this

Code: Select all

@echo off &start /LOW "Telnet Scripting Tool v1.0" "tst10.exe" /r:manuScript.txt &exit 0
manuscript

Code: Select all

[targetDomainName] [portNumber]
WAIT "server ready."
SEND "helo\m"
WAIT "Hello, ."
SEND "auth login\m"
WAIT "334 VXNlcm5hbWU6"
SEND "YmFzZTY0ZW5jPT0=\m"
WAIT "334 UGFzc3dvcmQ6"
SEND "PASSWORD_BASE64==\m"
WAIT "235 Authentication successful."

penpen
Expert
Posts: 1991
Joined: 23 Jun 2013 06:15
Location: Germany

Re: could anybody help with dos commands for this task

#17 Post by penpen » 10 Feb 2019 13:20

jraju wrote:
01 Feb 2019 20:27
the resutl was empty. Am i missing something there.Please kindly modify the script and i will try.
Sorry, i had few time last week so i couldn't post earlier.

I tried the windows built in telnet.exe-command, but it seems it can't heandle redirected input-/output-streams and exits immediately, so the solution (attempt) i gave doesn't work:
That's a little bit odd, because that should be a default way of interprocess communication of console programs and therefore should work with most console tools (and that's the reason i said, i would try that first).

The ommand line option '-f "filename"' should work.

So you have to stick with the solutions of Squashman and Ed Dyreen to control the input and use the log-file option to save the output to file (if needed).

penpen

Post Reply