Topic "Help Using ExecuteCommand? ls is unrecognized command."

Author Message
[View user's profile]

Joined: 2012-07-17
Posts: 1
Location: United States
Greetings. Thanks for all the effort in creating this library!

I'm trying to run a "ls" command against a plain old FTP server and I get an exception:

Syntax error, command unrecognized.

Here's the code:

CommandExecutionResult result = _session.ExecuteCommand("ls");

I must be missing something simple here. Any advice?

I'm using the 5.07 beta of WinSCP and the assembly.

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27106
Location: Prague, Czechia
There's no "LS" FTP command.

You probably wanted to use "LIST". But that won't work anyway for numerous reasons. Primary one being that for directory listing with FTP you need to open a separate channel. The listing is not part of a direct response to the LIST command.

Anyway, what's the point? There's Session.ListDirectory command:
Martin Prikryl

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License