winscp ls output to a file


Charles George
 

Just getting started with sftp via winscp, this command is not working for me: ls >dir.txt
Should it be working or do I have to use a log command or some other way just to get a directory listing to go to a file?

thanks.


Stephen Saxton
 

Hi Charles

I've been using a batch file which contains the following; and run it prior to running the WINSCP


rem goto drive
M:
rem change to directory needed
cd \hold dir
rem you can also put in an absolute path if you want the dir.txt to be located in another folder 
dir > dir.txt

There are also ways to name the "dir.txt" to a YYYY-MM-DD-mm-ss_dir.txt

Let me know if you need more info.




CABS²/AODs (Always Our Department software)
Senior Magic Software Engineer/IT Help Desk
954-330-7894
Facetime:  ssaxton2@...
Facebook Messenger:  ssaxton2@...
SKYPE:  ssaxton2
Retired USAF TSgt


-----Original Message-----
From: Charles George <Charles73@...>
To: main@magicu-l.groups.io
Sent: Wed, Mar 22, 2023 5:00 pm
Subject: [magicu-l] winscp ls output to a file

Just getting started with sftp via winscp, this command is not working for me: ls >dir.txt
Should it be working or do I have to use a log command or some other way just to get a directory listing to go to a file?

thanks.


Charles George
 

I need the directory listing from the remote sftp server vs. the local machine.


sherman levine
 

ls    From the ftp prompt?

Sherm


On Mar 22, 2023, at 21:50, Charles George <Charles73@...> wrote:

I need the directory listing from the remote sftp server vs. the local machine.


Charles George
 

from the winscp prompt.  Here's one way I found to make it work:
Winscp.com /script=script.txt /log=wscplog.txt | find ".xml" > file_list.txt