Page 1 of 1

move

Posted: 08 Dec 2010 04:05
by glob5
I try to use this script to log in a ftp site and move everything under a path to a different path. It does not work. :?

@echo off

> #.ftp echo o dot.com
>> #.ftp echo id
>> #.ftp echo pswd
>> #.ftp echo cd /dir1/dir2/dir3/

for /f "tokens=8, delims=" %%D in ('dir') do (
>> #.ftp echo move "%%D" "/dir1/dir2/dir4/"
)

>> #.ftp echo bye

ftp -s:#.ftp

Re: move

Posted: 09 Dec 2010 02:44
by glob5
any script that can move ftp:dirX\* to ftp:dirY\*?. all files and folders from dirX move to dirY.

Re: move

Posted: 13 Dec 2010 14:39
by ChickenSoup
I do not think this can be done with the built in windows FTP. You may try looking at a client like WinSCP and it's scripting options http://winscp.net/eng/docs/scripting
The mv command is probably what you need.

So your batch would call winscp with the script.

Code: Select all

winscp419.exe /console /script=WinSCP.txt


And your WinSCP.txt would look like this:

Code: Select all

option batch on
option confirm off
open user@ipaddress
mv /folder/* /folder2/*

View the scripting reference for more commands.

Re: move

Posted: 24 Dec 2010 18:37
by rfpd