Sign in to follow this  
Followers 0
MZXPTLK

ControlSend Problem

4 posts in this topic

:D Hi together,

i am writing a VB.Net program that establishes SSH-Connections using Putty.exe.

I use AutoItX component.

I have a problem sending "echo $SHELL", using ControlSend in the following Code:

iReturn = oAutoIt.ControlSend("[Handle:" & sHandle & "]", "", "", "echo $SHELL", 1)

ControlSend cannot interprete the '$' because it thinks it is a variable.

so the Putty-Window gets the string "echo 4SHELL" instead of "echo $SHELL".

What is the right syntax, thanks.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

:D Hi together,

i am writing a VB.Net program that establishes SSH-Connections using Putty.exe.

I use AutoItX component.

I have a problem sending "echo $SHELL", using ControlSend in the following Code:

iReturn = oAutoIt.ControlSend("[Handle:" & sHandle & "]", "", "", "echo $SHELL", 1)

ControlSend cannot interprete the '$' because it thinks it is a variable.

so the Putty-Window gets the string "echo 4SHELL" instead of "echo $SHELL".

What is the right syntax, thanks.

Hi,

try

$sendstring = "echo " & "$" & "Shell"

iReturn = oAutoIt.ControlSend("[Handle:" & sHandle & "]", "", "", $sendstring, 1)

or

iReturn = oAutoIt.ControlSend("[Handle:" & sHandle & "]", "", "", "echo " & "$" & "SHELL", 1)

;-))

Stefan

Edited by 99ojo

Share this post


Link to post
Share on other sites

try "{ASC 036}" instead of $

iReturn = oAutoIt.ControlSend("[Handle:" & sHandle & "]", "", "", "echo {ASC 036}SHELL", 1)

Share this post


Link to post
Share on other sites

thanx together,

both of them do not work as expected.

I think this is a problem of putty, will check again tomorrow ...

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