I need to create a batch file that goes to a protected FTP site, checks if a file type (*.txt
) exists, and if it does, proceed to the next step, if not, return a 0 and end the job.
I've done extensive searching and couldn't find any solutions.
I need to create a batch file that goes to a protected FTP site, checks if a file type (*.txt
) exists, and if it does, proceed to the next step, if not, return a 0 and end the job.
I've done extensive searching and couldn't find any solutions.
It's not a trivial task, particularly if you need to check for a file matching a mask (not for a specific file).
You can use WinSCP scripting:
The above code is from the WinSCP article on Checking file existence.
(I'm the author of WinSCP)