MZXPTLK Posted September 28, 2009 Posted September 28, 2009 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.
99ojo Posted September 28, 2009 Posted September 28, 2009 (edited) 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 September 28, 2009 by 99ojo
TurionAltec Posted September 28, 2009 Posted September 28, 2009 try "{ASC 036}" instead of $ iReturn = oAutoIt.ControlSend("[Handle:" & sHandle & "]", "", "", "echo {ASC 036}SHELL", 1)
MZXPTLK Posted September 28, 2009 Author Posted September 28, 2009 thanx together, both of them do not work as expected. I think this is a problem of putty, will check again tomorrow ...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now