move

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
glob5
Posts: 34
Joined: 23 Nov 2010 00:47

move

#1 Post by glob5 » 08 Dec 2010 04:05

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

glob5
Posts: 34
Joined: 23 Nov 2010 00:47

Re: move

#2 Post by glob5 » 09 Dec 2010 02:44

any script that can move ftp:dirX\* to ftp:dirY\*?. all files and folders from dirX move to dirY.

ChickenSoup
Posts: 79
Joined: 13 Dec 2010 10:32

Re: move

#3 Post by ChickenSoup » 13 Dec 2010 14:39

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.

rfpd
Posts: 78
Joined: 06 Jul 2009 16:19
Location: Lisbon, Portugal
Contact:

Re: move

#4 Post by rfpd » 24 Dec 2010 18:37


Post Reply