emule Posted March 6, 2009 Share Posted March 6, 2009 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:telnet 192.168.40.101Login: adminPassword: *from gui*set DataTraffic *from gui* Note: (1 = enabled & 0 = disabled)logoutyexitAny help is greatly appreciated. Link to comment Share on other sites More sharing options...
Prab Posted March 6, 2009 Share Posted March 6, 2009 (edited) Look at _RunDos() in the helpfile. Edit: and GUICtrlRead(). Edited March 6, 2009 by Prab FolderLog GuiSpeech Assist Link to comment Share on other sites More sharing options...
emule Posted March 6, 2009 Author Share Posted March 6, 2009 Here's what I have so far...it 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) Example() 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) GUISetState() Do $msg = GUIGetMsg() If $msg = $n2 Then Run("cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send("telnet ", GUICtrlRead($IP)) EndIf Until $msg = $GUI_EVENT_CLOSE EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now