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
202 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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 …
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

813 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