Topic "List of available files to text file"

Author Message


Hello, I'm hoping there's a simple answer for this.

My current FTP process (which is going to SFTP in the next 3 weeks) has several steps:

1. Retrieves a current directory list of several folders on an FTP site
2. Parses the generated file to find any 'new' files (compares file names against a SQL log)
3. If the file is new I generate a script that will download that file. (second FTP session)
4. Update SQL log with downloaded file name

Is there a way to pipe just the directory contents of a specific file. So let's say I had an SFTP site with the following directories:


With the innate windows FTP.exe the syntax is:

dir /Test1/Dir1 C:\ftp\test1\dir1\CurrentContents.txt
dir /Test1/Dir2 C:\ftp\test1\dir2\CurrentContents.txt
dir /Test2/Dir3 C:\ftp\test2\dir3\CurrentContents.txt

And these can all be run from the same FTP session.

Is there a similar functionality in WINScp?

I'm able to create a single log file that contains what i need but ideally I'd be able to keep the rest of my (powershell) script the same but just modify the batch files that perform the FTP functions.

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Sorry, I'm not sure what you mean by "directory contents of a specific file". But anyway, whatever it is, it does not look like something that WinSCP can do.

Anyway, since you are using PowerShell, it may be way easier for you to use WinSCP .NET assembly:

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