Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto ftp download

Status
Not open for further replies.

pork1977

Technical User
Feb 15, 2006
20
GB
Hiya,

I was wondering, my knowledge with vbscript is not too good and as of current I'm trying to create a script that when run automaticaly downloads all files in the root of the ftp location just to the root of my c drive - have done some digging around and come up with this script which works fine.....

set ftp = CreateObject("ChilkatFtp2.ChilkatFtp2")
ftp.UnlockComponent "any string begins the 30-day trial"

ftp.Username = "username"
ftp.Password = "pswd"
ftp.Hostname = "ftp.my.site."

ok = ftp.Connect()
if (ok <> 1) then
MsgBox ftp.LastErrorText
end if

' Download all files in the current remote FTP directory
' matching a pattern to a local directory.
localDir = "c:\"
remotePattern = "*.*"
numDownloaded = ftp.MGetFiles(remotePattern, localDir)


Only thing is, this script uses the 'Chilkat' activeX component to retrieve the files (I think I got that right!) and I wanted to know if windows (microsoft) has it's own so I needn't install any other third party software - if so how the hell would I modify this script ?!?

Any help would be greatly appreciated
 
In a console window type ftp -?
You may create on the fly a ftp script with the FileSystemObject and launch the program with the WshShell.Run method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sorry PHV, can you elaberate I am none the wiser yet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top