Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

How to FTP subdirectories in Windows, .vbs, c++, batch, any script!!

I've been searching and searching and wondering why there is no built-in functionality for FTP to send subdirectories (after all these years!). Does anybody have a script, even if it's in Visual Basic script, batch command, or c++ that can handle any number of subdirectory levels? The reason I need a script is for portablity and so I can put it on a scheduler. Thanks in advance for any help.
Avatar of jkr
jkr
Flag of Germany image

Judging from your requirements, you'll probably be better off using 'rsync' instead of FTP. You'll get The Windows version at http://sourceforge.net/projects/rsyncwin32/

For a tutorial, see http://www.fredshack.com/docs/rsync.html
Avatar of bemara57
bemara57

ASKER

The problem with this is that I have no SSH or access to the remote computer except for FTP. The remote computer is behind a firewall as well with only the FTP port open.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, If you need PERL for Windows: http://www.activestate.com/ActivePerl/
There is also the FTP command in DOS.

I've used it plenty for batch scripting.





Transfers files to and from a computer running an FTP server service

(sometimes called a daemon). Ftp can be used interactively.



FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]



  -v             Suppresses display of remote server responses.

  -n             Suppresses auto-login upon initial connection.

  -i             Turns off interactive prompting during multiple file

                 transfers.

  -d             Enables debugging.

  -g             Disables filename globbing (see GLOB command).

  -s:filename    Specifies a text file containing FTP commands; the

                 commands will automatically run after FTP starts.

  -a             Use any local interface when binding data connection.

  -A             login as anonymous.

  -w:buffersize  Overrides the default transfer buffer size of 4096.

  host           Specifies the host name or IP address of the remote

                 host to connect to.



Notes:

  - mget and mput commands take y/n/q for yes/no/quit.

  - Use Control-C to abort commands.

------------------------------------------------------------------------------------------------------

ftp> Commands may be abbreviated.  Commands are:



ftp> !            delete            literal            prompt            send
?            debug            ls            put            status
append            dir            mdelete            pwd            trace
ascii            disconnect      mdir            quit            type
bell            get            mget            quote            user
binary            glob            mkdir            recv            verbose
bye            hash            mls            remotehelp
cd            help            mput            rename
close            lcd            open            rmdir
>>There is also the FTP command in DOS.

... which cannot recurse.