Jump to content

Telnet


Recommended Posts

Hello all,

I would like to know how I can telnet a server in AutoIt. I need to be able to send commands(as a string), and receive any output.

I would like it to be written entirely in AutoIt, but I will use third-party software if it's required.

Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Link to comment
Share on other sites

Hello all,

I would like to know how I can telnet a server in AutoIt. I need to be able to send commands(as a string), and receive any output.

I would like it to be written entirely in AutoIt, but I will use third-party software if it's required.

It is easy to establish a connection with a telnet server using only Autoit.

Take a look at:

http://www.autoitscript.com/forum/index.php?showtopic=59744&view=findpost&p=449943

Link to comment
Share on other sites

Say I want to connect to the server 127.0.0.1, send a single command, then disconnect....how would I do that?

Edited by Vadersapien
Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Link to comment
Share on other sites

Say I want to connect to the server 127.0.0.1, send a single command, then disconnect....how would I do that?

Run( "Cmd.exe" )
Send("telnet")
Send("{Enter}")
Send("o")
Send("{Enter}")
Send("127.0.0.1")
Send("{Enter}")
Send("selfdestruct!")
Send("{Enter}")
Send("quit")

I did this off the top of my head so the "'s might be done wrong when Sending the keys anyway.. if it ends up not working add Sleep delays in between key sends. Batch files could do this as well fyi.

Link to comment
Share on other sites

Run( "Cmd.exe" )
Send("telnet")
Send("{Enter}")
Send("o")
Send("{Enter}")
Send("127.0.0.1")
Send("{Enter}")
Send("selfdestruct!")
Send("{Enter}")
Send("quit")

I did this off the top of my head so the "'s might be done wrong when Sending the keys anyway.. if it ends up not working add Sleep delays in between key sends. Batch files could do this as well fyi.

Not quite what I was looking for since not everyone has telnet installed...i wanted to do it like @notsure did or use TCP.au3
Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Link to comment
Share on other sites

  • 1 month later...

Run( "Cmd.exe" )
Send("telnet")
Send("{Enter}")
Send("o")
Send("{Enter}")
Send("127.0.0.1")
Send("{Enter}")
Send("selfdestruct!")
Send("{Enter}")
Send("quit")

I did this off the top of my head so the "'s might be done wrong when Sending the keys anyway.. if it ends up not working add Sleep delays in between key sends. Batch files could do this as well fyi.

Unfortunately this doesn't work with Windows 7 (error message says that telnet can't be found). Any idea how to start telnet? With Win XP I could use Run ("telnet") and telnet started. If I start telnet via cmd in Windows 7 manually everything works fine. Edited by mumu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...