Sign in to follow this  
Followers 0
techtonik

Send Control Characters To Console (?unicode Console?)

5 posts in this topic

Given one putty console (plink to be correct). The console is probably unicode (at least UTF-8 is specified in putty session options).

The task is to send ctrl-c to close window or ctrl-d command to logout from remote shell.

Problem: control codes typed from keyboard are transmitted correctly, but with AutoIt v3.1.1 Send() function they don't seem to work at all.

start "plink" plink session

This opens a new console window to remote shell. And then.

WinActivate("plink")
WinWaitActive("plink")
Send("{ASC 0067}")
Send("+{ASC 67}")
Send("!{ASC 67}")
Send("^{ASC 67}")
Send("+{ASC 0067}")
Send("!{ASC 0067}")
Send("^{ASC 0067}")
;Send("{CTRLBREAK}")
Send("{ASC 0013}")

This gives a string

[serv001]$ CCCCCCC
-bash: CCCCCCC: command not found
[serv001]$

Share this post


Link to post
Share on other sites



HI,

I cannot test it right now. Just a thought. Try ClipPut and right mouse.

So long,

Mega

P.S.: I know that even when it should work, it is now good solution. :">


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

I cannot test it right now. Just a thought. Try ClipPut and right mouse.

So long,

Mega

P.S.: I know that even when it should work, it is now good solution. :">

Well, ControlClick("plink", "", "", "right") works fine to paste text into the window in this case. The problem is how to get "ctrl+c" to clipboard. =) Any ideas?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ClipPut()

can be utilized in command controls... ie ControlSend()

see help

8)

Edited by Valuater

NEWHeader1.png

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