Solved

How do I transfer all files from a local directory to a web server directory via FTP / command line?

Posted on 2014-12-14
7
198 Views
Last Modified: 2014-12-20
I want to create a batch file that will move all files on my local PC to a folder on my web server using FTP with no prompts. How do I do this? Both systems are windows based.
0
Comment
Question by:mwmiller78
  • 4
  • 3
7 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 40499537
to run ftp from command prompt, do:

1- create text file like myftp.txt that contains

myusername
mypassword
prompt
bin
cd /remotedir
mput *.*
bye
2- run below command

ftp -n -s:myftp.txt myserver
0
 

Author Comment

by:mwmiller78
ID: 40505158
Do these values change? If so, what are they?
prompt
bin
cd /remotedir
mput *.*
bye

Where do I run that command? I tried from a command prompt and it told me ftp was not a recognized command.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40506259
what version of windows?

I have windows 7 and ftp works from command prompt (cmd).

prompt is and ftp client command to disable / enable confirmation when transferring multiple files.

bin is an ftp client command to set file type to binary
cd is an ftp client command to change dir on the remote system
mput is an ftp client to send multiple files to remote system (or you could use put for single file, or mget to get multiple files from remote system).
bye is an ftp client command to exit ftp client.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:mwmiller78
ID: 40508211
ok I got it to work. I guess there is an environment variable screwed up or something. anyhow...here is myphp.txt

myUser
myPass
prompt
bin
cd /secure/projectfiles
mput C:\Stuff\FTPtest\files\*.*
bye

then I ran this command:
ftp.exe -n -s:C:\Stuff\FTPtest\myftp.txt ftp.mydomain.com

and received the following:

 ss2.jpg
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40508592
ok, runt the ftp without -n
0
 

Author Closing Comment

by:mwmiller78
ID: 40511086
That did it. Thanks!
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 40511245
welcome
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

914 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

16 Experts available now in Live!

Get 1:1 Help Now