windows cmd ftp automatically download

1, the preparation of the bat ftp script:

set year=%date:~0,4%
set day=%date:~0,4%%date:~5,2%%date:~8,2%
mkdir d:\ftp\%date:~0,4%
mkdir d:\ftp\%date:~0,4%\%date:~0,4%%date:~5,2%%date:~8,2%
del d:\ftp\ftpcmd.txt

@echo open 172.18.73.122>>ftpcmd.txt
@echo product1>>ftpcmd.txt
@echo product1>>ftpcmd.txt
@echo binary>>ftpcmd.txt
@echo cd /products/Grib2/Grid_SM/%year%/%day%>>ftpcmd.txt
@echo lcd D:/ftp/%year%/%day%>>ftpcmd.txt

@echo prompt off>>ftpcmd.txt
@echo mget *>>ftpcmd.txt
@echo bye>>ftpcmd.txt
@echo quit>>ftpcmd.txt
@echo close>>ftpcmd.txt

ftp -s:D:/ftp/ftpcmd.txt

2, speaking run.bat script saved as a file, and then added to the windows scheduled tasks inside, but there are several considerations, as follows:

(1) Click Create task

Checking as shown, does not store the password.

(2) operation, the "Start in (optional)" Here you must fill in the appropriate directory where the execution of the program or BAT file, or else the implementation unsuccessful.

Guess you like

Origin www.cnblogs.com/tiandi/p/11965278.html