Jump to content

Enter Key In Putty


Recommended Posts

I'm trying to automati some data entry on a SSH session in putty but, i cant get the enter or tab key to work it stays on one field. here is the code i'm using

WinWaitActive("**************** - PuTTY")
Send("05/004/2006")
Send("{ENTER}")
Send("Y")
Send("{ENTER}")
Send("RXC05")
Send("{ENTER}")
Send("**-***-****")
Send("{ENTER}")
Send("01")
Send("{ENTER 2}")
Send("HICL")
Send("{ENTER}")
Send("*************")

Sleep(10000)

Send("PA")
Send("{ENTER 6}")
Send("15")
Send("{ENTER 4}")
Send("T")
Send("{ENTER 5}")
Send("APPROVED")
Send("{ENTER 7}")
Send("{F8}")
Send("{ENTER 9}")
Send("Y")
Send("{F3}")
Send("{F4}")

Any help would be appreciated.

Link to comment
Share on other sites

I'm trying to automati some data entry on a SSH session in putty but, i cant get the enter or tab key to work it stays on one field. here is the code i'm using

Any help would be appreciated.

Have you seen the function ControlSend()? you can send keys to a specific control (i.e. inputbox, button, radio-button, check-box, etc.) instead of using Send(). This will give your script some added stability. You can use the Au3Info.exe tool to find the control names you wish to use in a window/GUI.

As for the enter key not working, i suspect that the focus is being lost somehow or the keystrokes are being entered too quickly for putty and only appear to come up short.

Also try to get away from Sleep(), this can cause unexpected problems when a system gets slow for a moment and then Send()'s the wrong sequence of commands/functions. Try to hook an event like using WinWait(), WinExists(), etc.

Edited by MadSc13ntist
Link to comment
Share on other sites

Also try to get away from Sleep(), this can cause unexpected problems when a system gets slow for a moment and then Send()'s the wrong sequence of commands/functions. Try to hook an event like using WinWait(), WinExists(), etc.

alot of times you can use status bar messages to trigger continuance also. like i used to automate a telnet client at my old job, and i used the cursor position in the status bar to let my script know it was ok to continue.
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...