Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 671
  • Last Modified:

FTP via VBS script

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
duncan320
Asked:
duncan320
  • 2
1 Solution
 
lunchbyteCommented:
This is not a few lines of code, it is a little bit more involve. Are you using vb6?
0
 
lunchbyteCommented:
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
 
duncan320Author Commented:
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
 
hesCommented:
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

Hire Technology Freelancers with Gigs

Work with 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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now