I have searched the forum and found a few posts related to this question, but the answers I am looking for were not in the posts.
I am pulling my references from this post here.
In this batch file, the user has specified the following:
@echo off
echo user ahk@proflightsimulatoreview.com> ftpcmd.dat
echo ahktest>> ftpcmd.dat
echo put %1>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat ftp.proflightsimulatoreview.com
del ftpcmd.dat
My questions are as follows:
The put command says
%1
. If I wanted to specify a file in a different directory, could I just put the path of that directory after the put command? Assuming the bat file does not reside in the same dir as the file I want to send.The put command says
%1
, and the user executes theMYFTP.BAT c:\temp\hello.txt
from the command line. I am not executing anything from the command line but calling the bat file from another application. If I do not want to pass a parameter, can I hardcode in the path and replace the%1
?The
ftp
command is embedded in the.bat
file asftp -n -s:ftpcmd.dat ftp.proflightsimulatoreview.com
. If I wanted to remove the step of writing to a file then calling the file, what is the FTP syntax? What is the advantage of writing to a file and calling a file that you then delete vs just putting the values straight into the FTP command?