Sysax Product Forums / Sysax FTP Automation / General Discussion / Download most recent file only
Posted:  19 Dec 2014 01:56
Hi Folks,

Is anyone their tried to download just the most recent document on the remote server?

Can you help me out to do this. thanks in advance
Posted:  20 Dec 2014 17:54
Hi jdee00,

I have answered your ticket, so please check there.

For other readers, the solution I gave was to download all of the files to a temp folder, then use a batch file (set to run as part of the script) to copy the newest file to the destination folder, and then delete the files in the temp folder.

Here is the sample batch file:

pushd D:\Temporary
for /f "tokens=*" %%a in ('dir /b /od') do set newest=%%a
copy "%newest%" D:\Destination
cd \Temporary
del /q *.*
popd

Regards,
Sysax support
 

Copyright © 2021 Codeorigin, LLC - All Rights Reserved.
XML RSS 2.0 XML Atom 1.0