Execute method and su command - WeOnlyDo Discussion board

Execute method and su command (wodSSH / wodSSH.NET)

by M, Thursday, November 11, 2004, 18:01 (7097 days ago)

Hi,

I'm developing a program in VB.NET that has to do the following steps:

- connect to a remote host via password authentication
- execute the command su - newUsername
- wait for the system to ask the password (prompt= Password: ???)
- give the password to the system
- execute the command cd /myDir/
- execute the command nohup myScript.ksh &
- disconnect from the remote host

The biggest problem is that I can't understand how to set the return code/ prompt of every step.

Is it possible to perform all these steps using only the Execute method and avoiding to use PromptReceived and DataReceived events?
Can anybody pass me an example?

Any suggestion will be welcome.

M