Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Closed Issue: Issue Executing Mulitple Commands using SshClient [941]

$
0
0
<p>I have found an issue using the SshClient when I try to execute multiple commands such as changing directories followed by execution operation (e.g &quot;cd program files\\Smart tools &amp; start Reboot.exe /r&quot;) it crashes my application. Here is a copy of a function from my code to give you an idea of the tasks I am trying to perform.</p>
<p>&nbsp;</p>
<p>public void RebootDevice() {</p>
<p> </p>
<p> using (var devcon = new SshClient(_deviceaddr, &quot;user&quot;, new PrivateKeyFile(&quot;local.key&quot;)))</p>
<p> { </p>
<p> devcon.Connect(); </p>
<p> SshCommand DevCommand = devcon.CreateCommand(&quot;cd program files\\Smart tools &amp; start Reboot.exe /r&quot;);</p>
<p> try</p>
<p> {</p>
<p> DevCommand.Execute();</p>
<p> }</p>
<p> catch</p>
<p> { throw new Exception(&quot;Command Failed&quot;);</p>
<p> }</p>
<p> devcon.Disconnect();</p>
<p> } </p>
<p> }</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>This command (cd program files\\Smart tools &amp; start Reboot.exe /r ) performs the actions of changing the directory and executing reboot.exe perfectly in the shell enviroment but the SshClient execute function freezes my application and I have to kill the process when ever i try to perform this action from the code. Do you have any suggestions or fixes to this issue?</p>

Comments:

Old issue
Freeze should be resolve if not please let me know.


Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>