Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

DavidEmerson

Thanks Martin, I was seeing it as two separate parameters. Makes sense now.
martin

Re: ls command with wildcard error - Too Many Parameters

Indeed, the ls command takes only one parameter.
https://winscp.net/eng/docs/scriptcommand_ls
Is EIEPin a folder name? Then it should be:
ls EIEPin/*.txt
DavidEmerson

ls command with wildcard error - Too Many Parameters

Hi,

I am trying to get a list of files from a remote directory command but I'm getting an error
Too many parameters for command 'ls'

Here is the command line:
"C:\Program Files (x86)\WinSCP\winscp.exe"/script=C:\AATemp\FTP_basFTPScript.txt /log="C:\AATemp\FTP_log.xml"

Here is the script:
option batch on
option confirm off
open sftp://user:passwrd@sftp.sitename.co.nz -hostkey="ssh-rsa xxx="
ls EIEPin *.txt
Close
Exit

(Note the open line has actual details)

After running the script I get following in console:
Too many parameters for command �ls�.

If I run the command without the *.txt then it runs fine. How can I get only the filtered list of files?

Using WinSCP 5.17.7 on Windows 10.