Solved

FTP via VBS script

Posted on 2006-10-25
7
665 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month7 days, 3 hours left to enroll

623 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