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
move
Moderator: DosItHelp
-
- Posts: 79
- Joined: 13 Dec 2010 10:32
Re: move
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.
And your WinSCP.txt would look like this:
View the scripting reference for more commands.
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
see this website http://www.dostips.com/DtTipsFtpBatchScript.php