G
G
gotohell2017-12-18 23:37:27
cmd/bat
gotohell, 2017-12-18 23:37:27

How to send all files of a given type to FTP?

Hello! There is a task: send all files files from the C:\ drive with the .docx extension to the ftp server.
I have such a solution in two files:
export.bat

@echo %time% 
ftp -i -n -s:ftp.txt

ftp.txt
open ftp.site.ru
User login777 pas777
binary
mput C:/word/*.docx
bye

This code works, but it only copies files from the given folder. How can I make it send .docx files from the whole C:\ drive?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Olgeir, 2017-12-19
@Olgeir

@echo off
dir /b /s *.txt>_a12
echo open ftp.site.ru>>ftp.txt
echo User login777 pas77>>ftp.txt
echo binary>>ftp.txt
for /f %%a in (_a12 ) do echo mput %%a>>ftp.txt
echo bye>>ftp.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question