trying to create batch file for ftp
Posted on 2004-10-05
What I have there is a poor example of anything, I'm sure. I've tried everything. What I am trying to put together is a batch file that will, via ftp, check to see if a file exists, and if not, spit out a message. If it does exist, then the file will be downloaded. I have WS_FTP and I can create a batch to run it with the right parameters, but I can guess at this point that isn't what I will end up using. I got the following working, except the file name it is looking for is a local file just to test. What I really need is to check for a file on our web server and if it exists, download. If not, then say "No File" or something.
if exist %FILE% goto filefound
ECHO The file you requested is not available. Please try again later.
"C:\Program Files\WS_FTP Pro\wsftppro.exe" -s "myserver.host.com:/usr/www/users/slub/OM_data/QMExportFromFieldOffice.mdb" -d "local:C:\data\field_office_data\QMExportFromFieldOffice.mdb"