Solved

FTP via VBS script

Posted on 2006-10-25
7
658 Views
Last Modified: 2008-02-01
I have very basic knowledge of writing .vbs scripts.

I need a very basic script that will copy say all *.sql from a server to say c:\ftp on the PC it is been run on, i have no idea how to do this, but i need to do the following :

connect to the ftp server
with username & password
change into a certain directory say /etc/backup on the remote server
and then copy *.sql to c:\ftp
disconnect

Can someone please provide me with an example.  Im sure this will be a few lines of code, but it knowing what.

Many Thanks
0
Comment
Question by:duncan320
  • 2
7 Comments
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17804639
This is not a few lines of code, it is a little bit more involve. Are you using vb6?
0
 
LVL 5

Expert Comment

by:lunchbyte
ID: 17804689
Here is a sample codes from freevbcode.com. Good place to get samples and they have few sample codes for FTP.

http://freevbcode.com/ShowCode.Asp?ID=731
0
 
LVL 1

Author Comment

by:duncan320
ID: 17805298
I was hoping to do it with a VBS script if i can.

Have tried the like given by lunchbyte but it wont let me download the file it says its invalid or corrupted.

Thanks
0
 
LVL 20

Accepted Solution

by:
hes earned 125 total points
ID: 17807889
You can do this in a batch file
in your batch file add
FTP -s:ftpscript.txt ftpserver  ' ftpserver is your ftp server

in ftpscript.txt or whatever you want to name it put

username
password
cd /etc/backup
binary
mget *.sql
bye
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question