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

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Creating a telnet-batchfile

Reply to Message Icon

Original Message
Name: Henriko
Date: June 4, 2002 at 14:49:52 Pacific
Subject: Creating a telnet-batchfile
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


Report Offensive Message For Removal


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

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


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal

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

Got it?

Hmm... Sorry.. no ;)


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal

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

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


Report Offensive Follow Up For Removal







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








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge
Poll History




Data Recovery Software