Sign in to follow this  
Followers 0

Need a few simple telnet commands executed

3 posts in this topic

I'm looking to automate a few telnet commands via a GUI. It needs to have the ability to input the IP address then launch the telnet session executing commands based on what has been specified in the GUI. I'm a complete newbie at anything related to programing. I'm a wireless internet engineer : ( This is needed to enable/disable the ethernet port on a device.


The Telnet code looks like this:


Login: admin

Password: *from gui*

set DataTraffic *from gui* Note: (1 = enabled & 0 = disabled)




Any help is greatly appreciated.

Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

Look at _RunDos() in the helpfile.

Edit: and GUICtrlRead().

Edited by Prab

Share this post

Link to post
Share on other sites

Here's what I have so works up to the point where it needs to include the IP address but nothing shows up. Obviously, this code was taken from the help, but I may have butchered it.

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)


Func Example()
    Local $IP, $n2, $msg
    GUICreate("My GUICtrlRead")
    $IP = GUICtrlCreateInput("", 10, 10, -1, 20)
    $n2 = GUICtrlCreateButton("OK", 10, 30, 50)
    GUICtrlSetState(-1, $GUI_FOCUS)
        $msg = GUIGetMsg()
        If $msg = $n2 Then

        Send("telnet ", GUICtrlRead($IP))

    Until $msg = $GUI_EVENT_CLOSE

Share this post

Link to post
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
Sign in to follow this  
Followers 0