Hey Jayjo,
I've been doing quite a bit of this recently in our conversion from unix to win2k. It's actually not too hard once you get it going. Are you trying to ftp out just one specific file (i.e. log file) or is this a dynamically changing file name? If you need to specify the filename, that's workable too. Here's a batch script (i modified it a bit to try to suit your situation more) that you can try out. We use this to backup to a remote server and it works well. you will need to pass in parameters to get it going. lemme know if this is what you are looking for:
:: Script to ftp single file to remote server
:: It needs:
:: $1 = host
:: $2 = directory to ftp to
:: $3 = full path of file to be sent
@ECHO OFF
SETLOCAL
SET username=<your username>
SET PASSWD=<your password>
:: check # of arguments
IF [%1] ==[] (ECHO Wrong number of arguments
goto done)
IF [%2] ==[] (ECHO Wrong number of arguments
goto done)
IF [%3] ==[] (ECHO Wrong number of arguments
goto done)
:: check directory to use is of the correct form then send
:: use these 3 lines if you want to ensure
SET correctstr=<first three letters of directory...i.e. /ho for /home>
SET passedstr=%2
:: you can change the 0,3 here to be sensitive to more characters.
:: ~0,3 means look at first 3 from the beginning
SET passedstr=%passedstr:~0,3%
:: creates temp file with ftp script rdy. deletes when it's done. add in other command lines as needed.
IF %passedstr% EQU %correctstr% (
> d:\scripts\ftp_script echo %username%
>> d:\scripts\ftp_script echo %password%
>> d:\scripts\ftp_script echo ascii
>> d:\scripts\ftp_script echo prompt
>> d:\scripts\ftp_script echo cd %2
>> d:\scripts\ftp_script echo mput %3
>> d:\scripts\ftp_script echo bye
ftp -s:d:\scripts\ftp_script %1
del d:\scripts\ftp_script
)ELSE (
ECHO Incorrect Directory: %2
goto done
)
:done
ENDLOCAL