Computing.Net > Forums > Disk Operating System > Creating a telnet-batchfile

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Creating a telnet-batchfile

Reply to Message Icon

Name: Henriko
Date: June 4, 2002 at 14:49:52 Pacific
Comment:

Hi!
I want to create a batchfile that:
telnet [ip]
types in login and password automaticly
attaches BitchX (scr-bx)
changes nick in bitch
detaches
and logs out

Is this possible, if so; how? :) If you have the time, PLEASE send me the batfile in mail



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: June 4, 2002 at 16:30:54 Pacific
Reply:

Just create a script file with the commands you would type. Example:

open [ip]
USER username
PASS password
bye

Note: it's better to have the program to log into IP from a internal command, not by "TELNET [IP]", if possible.

After creating such script, do:
TELNET < SCRIPT.TXT
-- or, to supress the output --
TELNET < SCRIPT.TXT > NUL

Now, in order to do that via batch file, just create the script via batch file, like this (I'll use as example the same script I created above):

@echo off
echo open [ip]> %temp%.\script.dat
echo USER username>> %temp%.\script.dat
echo PASS password>> %temp%.\script.dat
echo bye>> %temp%.\script.dat
TELNET < %TEMP%.\SCRIPT.DAT > NUL
del %temp%.\script.dat

Got it? Some programs (such as FTP.EXE) will ask username and password by default, and you need to include a switch when calling it so it won't do that (it will 'wait' for you give the USER and PASS commands)

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 2
Name: Secret_Doom
Date: June 4, 2002 at 16:35:47 Pacific
Reply:

Oops, I thought TELNET was a line-by-line program, such as FTP.EXE, but I checked and it's not!

Forget everything I said ...

Sorry about that.

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 3
Name: Henriko
Date: June 4, 2002 at 16:43:02 Pacific
Reply:

Got it?

Hmm... Sorry.. no ;)


0

Response Number 4
Name: Henriko
Date: June 4, 2002 at 16:43:50 Pacific
Reply:

uhm... ok, so its not possible then?


0

Response Number 5
Name: Secret_Doom
Date: June 4, 2002 at 16:57:06 Pacific
Reply:

Didn't say it's not possible, just that I don't know how to do it.

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Creating a telnet-batchfile

Creating a BATCH script www.computing.net/answers/dos/creating-a-batch-script/163.html

Create a Menu www.computing.net/answers/dos/create-a-menu-/3225.html

creating a directory listing www.computing.net/answers/dos/creating-a-directory-listing/9034.html