0
votes

I have an FTP batch script, which when run manually works, but when ran in a batch file does not. Here is the content of the batch script:

@echo OFF
rem  * *******************************************************************
rem  *               ftp mget                            *
rem  *                                           *
rem  *                                               *
rem  *                                                   *
rem  *                                                   *
rem  * *******************************************************************
echo *
echo *
echo *
ftp -n -i -s:C:\Scripts\testget.txt >C:\Scripts\testmget.log

Text file contents:

open myftpsite.com
user user1 password  
user "[email protected] 12234" PASSWORD
prompt 
binary
mget %%myfile3%
mget %%myfile2%
mget %%myfile1%
bye
close

after this runs I look at the log and it completes running every line without an error but after every line I get: 200 TYPE set to I and then the script completes with no files being retrieved to my current directory. As mentioned earlier when i run the commands in the txt file manually and use mget . It retrieves all of my files to my local dir. I also tried mget . in the txt file and this did not work either.

Thanks in advance for any suggestions.

1

1 Answers

0
votes

EDIT: This now has the filespecs hard coded in the batch code.

@echo OFF
rem  * *******************************************************************
rem  *               ftp mget                            *
rem  *                                           *
rem  *                                               *
rem  *                                                   *
rem  *                                                   *
rem  * *******************************************************************
echo *
echo *
echo *

(
echo open myftpsite.com
echo user user1 password  
echo binary
echo mget *.MAC
echo mget *.DAT
echo mget *.DAC
echo bye
)>C:\Scripts\testget.txt

ftp -n -i -s:C:\Scripts\testget.txt >C:\Scripts\testmget.log