Home All Groups Group Topic Archive Search About
Author
9 Mar 2009 10:20 AM
Sanford Aranoff
Using Windows Explorer, I can go to my ftp:\\ directory,
enter my password, and then copy files from the hard disk to
my Internet site. Can I write a command line which will go
to the ftp site and enter the password? This way I can write
a program that will open the ftp site, upload files, and
close the ftp site.

Thanks.

Author
9 Mar 2009 11:09 AM
Alister
On Mar 9, 10:20 am, Sanford Aranoff <aran***@analysis-knowledge.com>
wrote:
> Using Windows Explorer, I can go to my ftp:\\ directory,
> enter my password, and then copy files from the hard disk to
> my Internet site. Can I write a command line which will go
> to the ftp site and enter the password? This way I can write
> a program that will open the ftp site, upload files, and
> close the ftp site.
>
> Thanks.

This is not really the correct newsgroup for this question, however:

You can pass command line parameters to the built in ftp client in
most versions of windows
by using a batch file coupled with a text file list of the commands.

In the batch file you have the following:

@echo off
ftp -s:unattend.txt ftp.myftpsite.dom

This tells ftp to use unattend.txt to pass commands to the FTP
program.
The contents of unattend.txt would look like this:

USER username
password
(may need) cd /where/I/want/to be
binary
prompt n
mput myfile.ext
bye


This will logon, change directory if needed and then upload the file
and disconnect.

This is NOT secure as your password is stored in plain text in the
unattend.txt file.

However if you were thinking of writing a program to pass these
commands you could create the unattend.txt on the fly and delete it
after the transaction has completed.

HTH

Alister
Are all your drivers up to date? click for free checkup

Author
23 May 2009 9:19 AM
Philip Herlihy
Sanford Aranoff wrote:
> Using Windows Explorer, I can go to my ftp:\\ directory,
> enter my password, and then copy files from the hard disk to
> my Internet site. Can I write a command line which will go
> to the ftp site and enter the password? This way I can write
> a program that will open the ftp site, upload files, and
> close the ftp site.
>
> Thanks.

Webdrive (www.webdrive.com) is really good for enabling scripting access
to FTP sites.  Mounts the site as a network drive, so any program can
access the site.  Used it for years.

Phil, London

Bookmark and Share