This project is read-only.

Help with Running Applications

Mar 6, 2012 at 9:01 AM

hey~

Recently I was doing a .NET project with SSH requirments , I was wondering how to run a application on a rmote computer?

SshClient^ ssh = gcnew SshClient("192.168.1.204","admin","111111");
 ssh->Connect();
SshCommand^ cmd = ssh->CreateCommand("ls;./home/users/xxx/xxx");
cmd->Execute();
this->richTextBox1->AppendText((cmd->Result);
ssh->Disconnect();

 I tried to excute SSH commands like 'ls -lh' and it works just fine.

But when I tried to excute a program like ./home/users/apple/xxx, there is no response nor exception.

I'm a amateur in SSH....so anything would be helpful ~ thx very much~

 

 

Mar 6, 2012 at 9:04 AM

Oh and the application on the remote server is a web crawler, I want to start it using some command like "nohup" so it will keep running even if the session is disconnected.

Mar 13, 2012 at 2:24 PM

Hi,

 

Sorry for late response,

 

Another thing that you might want to check is ExitStatus property.

if it has 0 the command was executed successfully, otherwise it will contain exit error code.

 

Hope it helps.

 

Thanks,

Oleg

Nov 5, 2014 at 2:04 PM
Maybe it's bit off topic, but when I'm trying to run nohup with whatever command I become only error 126. Can you please help me?