windowscmdftp

How to specify the target location for downloading the remote file using mget command?


I have a batch file to do the bulk copy the file from remote location. This is working fine. But here I want to specify the local system location (target location).

Sample:

 cd test/test
 mget sample_*.zip
 quit

Solution

  • Use the lcd /path to change the current local working directory:

    cd /source_remote_path
    lcd /destination_local_path
    mget sample_*.zip
    quit
    

    See the ftp man page.

    If you are running Windows locally, use Windows style path, of course:

    lcd c:\destination_local_path
    

    See the Windows ftp.exe lcd command help.