Topic "SFTP logic File Already Exists"

Author Message
Cecil Xavier

Guest


Good day all,
I'm a novice user so I appologize in advance. I am trying to write a script that will check one windows directory for a file name (example u0731130.dat) before it tries to download a file (example ub04073113.dat) to a different windows directory. It will run through all the files in a specific directory and then quit.
I have been able to make a script that that connects, browses to the folder on the ftp server and download anything in there to the windows directory that I am currently in when I run winSCP. But, that is it. Any help would be greatly appreciated.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
If I understand it correctly, you are missing the part to check for existence of the a local file to trigger the WinSCP script.
Such task is out of scope of this forum. Please ask elsewhere, for example on http://superuser.com/
_________________
Martin Prikryl
Guest




Not outside the winSCP script, but in it. When the script fires off it connects to a site, changes folders and downloads all thats in the folder. What I want it to do is look before it downloads. I think that is inside the script.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Why don't you check before you run the script?
You probably do not share some constraints with us.
Anyway, if you insist on your approach, I recommend you to use WinSCP .NET assembly from PowerShell script:
https://winscp.net/eng/docs/library
https://winscp.net/eng/docs/library_powershell
https://winscp.net/eng/docs/library_session_getfiles#powershell
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License