PDA

View Full Version : completeing a .cmd file


soloWebDev
10-16-07, 11:24 AM
<if this is not in the correct place please move>
I am trying to complete this .cmd file, and the part I am missing is the location of where I want it to save the file to. can someone take a look and let me know if you notice something, and or have the missing piece. thanks
open ftpAddress
user name
password
FOR /f "tokens=1-4 delims=/ " %%a in ('date /t') do (@set wd=%%a& set m=%%b& set d=%%c& set y=%%d)
copy ftp_info.logs.gz dynamic_info.logs.gz
echo get %m%-%d%-%y%FILENAME.logs.gz >> dynamic_info.logs.gz
echo quit >> dynamic_info.logs.gz
del dynamic_info.logs.gz


I am trying to grab the latest dated file, and save it. the files are named
ex. Oct1.logs.gz, Dec15.logs.gz

eggi
11-11-07, 07:32 PM
Hey There,

The easiest thing to do would be to execute a cd to where you want the files to be before invoking ftp

cd c:\downloads
open ftpAddress

or you could give two arguments to the "get" command in ftp:

get %m%-%d%-%y%FILENAME.logs.gz c:\downloads\%m%-%d%-%y%FILENAME.logs.gz

Hope that helps or I'm not way off base on what you're looking for :)

, Mike