Sign in to follow this  
Followers 0
Tamaro

Enter Key In Putty

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

You might need to tweak Opt("SendKeyDelay", ...

I used AutoIt with putty a long time ago, and I think I had to lower the send speed or hard code sleep delays for it to work reliably.


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It work's thanks a lot.

Edited by Tamaro

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