0
다음 배치 스크립트를 사용하여 FTP에 연결하고 호스트에서 파일을 가져옵니다. (ftpscript.bat)호스트 목록을 통한 반복 스크립트 FTP 루프
@echo off
@ftp -i -s:"%~f0"&GOTO:EOF
open host1
username
password
cd apples
bin
hash
get fileName.txt fileName.host1
disconnect
호스트 목록이 포함 된 다음 텍스트 파일이 있습니다. (HOSTS.TXT)
host1
host2
host3
host4
어떻게 할 수있는 파일의 각 호스트 파일의 각 라인과의 호스트 변수이 스크립트를 실행을 통해 I 루프?
@echo off
@ftp -i -s:"%~f0"&GOTO:EOF
open host1
username
password
cd apples
bin
hash
get fileName.txt fileName.host1
disconnect
open host2
username
password
cd apples
bin
hash
get fileName.txt fileName.host2
disconnect
open host3
username
password
cd apples
bin
hash
get fileName.txt fileName.host3
disconnect
open host4
username
password
cd apples
bin
hash
get fileName.txt fileName.host4
disconnect
'열기','사용자 이름 '앞에 echo 문을 잊어 버렸습니다. – wimh
완벽하게 작동합니다. FOR의 모든 내용이 반향되어 파일에 출력됩니다. 그것은 나를 위해 ftpscript.bat를 만들 것입니다. – Jsn0605
@Wimmel Doh, 고마워, 내가 편집 할거야! –