Solved

creating a script to schedule a bat file to connect to ftp site

Posted on 2008-10-10
4
1,797 Views
Last Modified: 2013-12-02
I need to create and schedule a script that runs on db server on windows plateform which runs certain sql-creates a output and then send the output to ftp site. If someone has worked on somthing like this I can use that as template and work on my own. Let me know.
thanks.
0
Comment
Question by:barfi
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 22689665
create a text file e.g. myftp.txt, like the one below :

username1
password1
lcd c:\mydir
cd /remdir
put file
quit

Here in the file above, username1 and password1 are the username and password on the ftp server
You may put the command binary or ascii before the put command
If you want to send multiple files then change the put command to

prompt
mput files*.* (for example)

Now create a .bat file that contains the command

ftp -s:c:\myftp.txt remoteserver

here remoteserver is the hostname or the ip address of the ftp server

Now schedule the .bat file to run at the time you want
0
 
LVL 2

Author Comment

by:barfi
ID: 22689757
Hi
This looks perfect - I just need to try and test it but I am staisfied with your answer. I just have a question on following commands:
lcd c:\mydir (is this command cding to the location of the file)
cd /remdir (what is this command doing?)
put file (should I say the name of the file after put or after put file then file name)
Sorry- if I am asking dummy qs but  this is my first time doing this and would like to get it all straighten out.
Thanks again
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 22689959
OK

I gave complete example where you use

cd /remdir

to change your dir on the ftp server to /remdir. This could be

cd c:\myremdir

if the remote server is a windows ftp server.

put is the command to sent a file to remote system. Please put your actual file name:

put myfile.dmp
0
 
LVL 2

Author Closing Comment

by:barfi
ID: 31505139
Thanks a Bunch!! I will try this out.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Samba is the de-facto standard program (or, more correctly: suite of programs) that UNIX and Linux systems use to share files with Microsoft Windows (and more recently, Mac OS-X) systems. Currently, there are 2 common versions of Samba available,…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now