AutoHotkey Community

It is currently May 25th, 2012, 6:16 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: August 30th, 2007, 8:10 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
Hi,

i am trying to reuse an old script of mine that was used to connect to telnet session.

when i just changed the command line and the simulated keys to send i noticed that the controlsend only sends the numbers but not the letters :D

Code:
;#NOTrayICon
SendMode InputThenPlay ; thought it might do somthing, tried all modes
Gui, Show, h60 w200, SSH
Gui, Add, Button, x5 y5 w80 h30 gSSH1, Test
Gui, Add, Button, x115 y5 w80 h30 gSSH2 ,CISCO Test
Gui, Add, Text, x5 y40 w195 h15 Center, bla bla
Return

SSH1:
Run, %comspec% /k cmd ,%A_WorkingDir%, Max, TelnetPID
Sleep, 10000
ControlSend,, metal38{enter}, ahk_pid %TelnetPID%
Sleep, 5000
ControlSend,, jdt54b{enter}, ahk_pid %TelnetPID%
Return

SSH2:
Run, %comspec% /k plink 172.17.1.99 -l cisco -pw 12345 -P 22 ,%A_WorkingDir%, Max, TelnetPID
Sleep, 5000
ControlSend,, n{enter}, ahk_pid %TelnetPID%
Sleep, 5000
ControlSend,, jdt54b{enter}, ahk_pid %TelnetPID%
Return

Return
GuiClose:
ExitApp


maybe i am doing something wrong :roll:

check the first button it opens up a cmd and you will see only numbers appears not the whole word.

i am using vista ultimate 32bit
and AHK 1.0.47.04

Thanks in advance,
Twhyman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2007, 4:56 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Although I don't know of any problems with ControlSend under Vista, ControlSend isn't compatible with all types of applications.

You could try granting the script admin privileges to see if that helps:
Code:
if not A_IsAdmin
{
   DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
      , str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
   ExitApp
}

If that's not it, you could try experimenting with SetKeyDelay.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 1st, 2007, 5:03 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
I don't have any problems sending text to Console windows - Vista Business 32bit, AHK 1.0.47.04.
Code:
ControlSend,, echo abc123`n, ahk_class ConsoleWindowClass
Neither the console nor AutoHotkey are running with admin privileges.

The code you posted also works.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ControlSend problems
PostPosted: October 20th, 2007, 7:25 pm 
Offline

Joined: August 19th, 2005, 4:36 pm
Posts: 14
Location: Germany
I have problems too with ControlSend.
I found out that it only happens on dual-core CPUs that wrong characters are typed. ( like shift key is pressed too long ).

Had to change all occurences of ControlSend to Send,


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group