Re: Login, su to root, execute command (General questions)
Shin,
Please try this:
[code]<set ssh = CreateObject( WeOnlyDo.wodSSHCom.1 )
ssh.Login = name
ssh.Password = pwd
ssh.Hostname = ip
ssh.Blocking = 1
ssh.Protocol = 1
ssh.Port = 23
ssh.Timeout = 30
ssh.Connect
ssh.WaitFor regex:[$ #>] $ ,30
ssh.Send rsh server2 & vbLf
ssh.DataReady = 0
ssh.WaitFor regex:[$ #>] $ ,30
a = ssh.Execute( ls & vbLf, regex:[$ #>] $ ,30)
ssh.Disconnectresponse.write a
>[/code]
Drazen
Thanks a lot, Drazen !
This code works normally & stably.
But why the original code can't work ?
What's the different between execute and send ?
Complete thread:
- Login, su to root, execute command - wodSupport, 2004-11-11, 23:25
- Re: Login, su to root, execute command - M, 2004-11-12, 13:58
- Re: Login, su to root, execute command - wodSupport, 2004-11-12, 14:29
- Re: Login, su to root, execute command - M, 2004-11-12, 15:50
- Re: Login, su to root, execute command - wodSupport, 2004-11-12, 15:52
- Re: Login, su to root, execute command - M, 2004-11-12, 18:01
- Re: Login, su to root, execute command - wodSupport, 2004-11-12, 18:02
- Re: Login, su to root, execute command - iyikedi, 2005-03-21, 19:12
- Re: Login, su to root, execute command - wodSupport, 2005-03-21, 20:12
- Re: Login, su to root, execute command - Kaliorin, 2005-08-19, 09:08
- Re: Login, su to root, execute command - wodSupport, 2005-08-19, 11:01
- Re: Login, su to root, execute command - kaliorin, 2005-08-19, 11:09
- Re: Login, su to root, execute command - kaliorin, 2005-08-19, 16:06
- Re: Login, su to root, execute command - wodSupport, 2005-08-19, 17:26
- Re: Login, su to root, execute command - Kaliorin, 2005-08-22, 16:07
- Re: Login, su to root, execute command - shin, 2008-05-27, 05:37
- Re: Login, su to root, execute command - shin, 2008-05-27, 05:39
- Re: Login, su to root, execute command - wodDamir, 2008-05-27, 09:26
- Re: Login, su to root, execute command - shin, 2008-05-30, 05:13
- Re: Login, su to root, execute command - shin, 2008-05-30, 05:26
- Re: Login, su to root, execute command - woddrazen, 2008-05-30, 09:11
- Re: Login, su to root, execute command - shin, 2008-06-09, 09:38
- Re: Login, su to root, execute command - woddrazen, 2008-06-09, 10:02
- Re: Login, su to root, execute command - shin, 2008-06-23, 10:40
- Re: Login, su to root, execute command - woddrazen, 2008-06-23, 11:50
- Re: Login, su to root, execute command - shin, 2008-06-24, 03:54
- Re: Login, su to root, execute command - shin, 2008-06-24, 03:59
- Re: Login, su to root, execute command - wodDamir, 2008-06-24, 09:14
- Re: Login, su to root, execute command - shin, 2008-06-24, 03:59
- Re: Login, su to root, execute command - shin, 2008-06-24, 03:54
- Re: Login, su to root, execute command - woddrazen, 2008-06-23, 11:50
- Re: Login, su to root, execute command - shin, 2008-06-23, 10:40
- Re: Login, su to root, execute command - woddrazen, 2008-06-09, 10:02
- Re: Login, su to root, execute command - shin, 2008-06-09, 09:38
- Re: Login, su to root, execute command - woddrazen, 2008-05-30, 09:11
- Re: Login, su to root, execute command - shin, 2008-05-30, 05:26
- Re: Login, su to root, execute command - shin, 2008-05-30, 05:13
- Re: Login, su to root, execute command - wodDamir, 2008-05-27, 09:26
- Re: Login, su to root, execute command - shin, 2008-05-27, 05:39
- Re: Login, su to root, execute command - shin, 2008-05-27, 05:37
- Re: Login, su to root, execute command - Kaliorin, 2005-08-22, 16:07
- Re: Login, su to root, execute command - wodSupport, 2005-08-19, 17:26
- Re: Login, su to root, execute command - kaliorin, 2005-08-19, 16:06
- Re: Login, su to root, execute command - kaliorin, 2005-08-19, 11:09
- Re: Login, su to root, execute command - wodSupport, 2005-08-19, 11:01
- Re: Login, su to root, execute command - Kaliorin, 2005-08-19, 09:08
- Re: Login, su to root, execute command - wodSupport, 2005-03-21, 20:12
- Re: Login, su to root, execute command - iyikedi, 2005-03-21, 19:12
- Re: Login, su to root, execute command - wodSupport, 2004-11-12, 18:02
- Re: Login, su to root, execute command - M, 2004-11-12, 18:01
- Re: Login, su to root, execute command - wodSupport, 2004-11-12, 15:52
- Re: Login, su to root, execute command - M, 2004-11-12, 15:50
- Re: Login, su to root, execute command - wodSupport, 2004-11-12, 14:29
- Re: Login, su to root, execute command - M, 2004-11-12, 13:58