AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ControlSend only send Numbers

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
twhyman



Joined: 07 Dec 2005
Posts: 218

PostPosted: Thu Aug 30, 2007 8:10 am    Post subject: ControlSend only send Numbers Reply with quote

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 Very Happy

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 Rolling Eyes

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
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Fri Aug 31, 2007 4:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Lexikos



Joined: 17 Oct 2006
Posts: 2540
Location: Australia, Qld

PostPosted: Sat Sep 01, 2007 5:03 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
hps



Joined: 19 Aug 2005
Posts: 14
Location: Germany

PostPosted: Sat Oct 20, 2007 7:25 pm    Post subject: ControlSend problems Reply with quote

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,
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group