Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need to automate an FTP transfer. I can copy the files (with a batch file) to my computer. But after I copy the files, I need to move them into a subdirectory on the remote server to show they've been copied. (I have to be careful that other files that may be placed onto the server during the get operation aren't prematurely moved into the subdirectory.)
I am running the FTP command via batch:
ftp -s:ftp.txtftp.txt looks like this so far:
open 10.10.10.10
user
password
lcd D:\claims
mget *.*
cd downloadedNow I need to take all the files I've copied and move them into the subdirectory "downloaded" on the server. Any suggestions?

This gets all html and moves 'em to somefolder. Season to taste.
==============================================
:: get some files via ftp then move the got files on server@echo off
setLocal EnableDelayedExpansion> ft.do echo o my.com
>> ft.do echo user
>> ft.do echo pass
>> ft.do echo bin
>> ft.do echo prompt
>> ft.do echo mget *.html
>> ft.do echo byeftp -s:ft.do > getlog
del ft.dofind "Opening BINARY" < getlog > gotlog
> ft.do echo o my.com
>> ft.do echo user
>> ft.do echo pass
for /f "tokens=8 delims= " %%a in (gotlog) do (
>> ft.do echo rename %%a somefolder/%%a
)
>> ft.do echo byeftp -s:ft.do
del ft.do
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |