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
190 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Cisco MRA Phones 4 15
For loop to add numbers 3 26
Route summarization 9 44
Cisco VSS or VCP on GNS3 or IOU 3 33
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

22 Experts available now in Live!

Get 1:1 Help Now