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

Created Unassigned: Double quotes in command [2744]

$
0
0
Hi.

Thank you for ssh.net library.

I'm having an issue when trying to use double quotes in a command executed on a ssh server running on Windows.

```
ConnectionInfo connectionInfo = new ConnectionInfo(
"hostname",
22,
"username",
new AuthenticationMethod[] { new PasswordAuthenticationMethod("username", "password") });

using (SshClient sshclient = new SshClient(connectionInfo))
{
sshclient.Connect();

SshCommand sshCommand = sshclient.CreateCommand("tasklist /FI \"SessionName eq Console\"");

string output = sshCommand.Execute();

Trace.WriteLine(string.Format("ExitStatus: {0}", sshCommand.ExitStatus));
Trace.WriteLine(string.Format("Output: {0}", output));

string result = sshCommand.Result;
string error = sshCommand.Error;
Trace.WriteLine(string.Format("Result: {0}", result));
Trace.WriteLine(string.Format("Error: {0}", error));

sshclient.Disconnect();
}
```
Result:
```
ExitStatus: 0
Output:
Result:
Error: ERROR: The search filter cannot be recognized.
```

Any ideas?

Thank you.

Viewing all articles
Browse latest Browse all 1026

Trending Articles



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