Jump to content

ControlSend Problem


MZXPTLK
 Share

Recommended Posts

: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.

Link to comment
Share on other sites

: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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...