Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Line FTP 1

Status
Not open for further replies.

shmoes

MIS
Joined
Apr 24, 2003
Messages
567
Location
CA
Hey all,

I want to create a command line ftp send that i can put in scheduler to send every 6hrs or so .. how would i create that in windows 2k?

connect to site > upload > overwrite current > disconnect > create log file locally

the last one is optional

Thanks!!

~Shmoes

I lay claim to nothing and everything. My words may be wisdom or disaster. In the end you make a choice. Noone is perfect.
 
Shmoes,

this should get you on your way:
create a .bat file let's call it put.bat and put the following in

@echo off
chdir c:\directory where your files are and somefile.text is located
ftp -n -d -s:somefile.txt 255.255.255.255 (where 255 etc is the ip you want to ftp to)

next create a file called somefile.txt and put the following in

user username userpassword
binary
cd /whereever (remote directory)
put filenamelocal filenameremote
cd /toantherplace (another remote directory)
put filenamelocal2 filenameremote2
bye

this covers all but the log and you sould be able to create one, maybe by turning @echo on and redirecting (>>) to another file. i'll check on it whe i get a chance. w2k help also has a lot on the ftp commands.

regards,

longhair
 
Thanks, Longhair

I will try it and let you know how it goes..

do you know if

put *.* *.*
will work ?

It's one directory with multiple files.. do i have to specify the name of each one because they change?

Thanks again




~Shmoes

I lay claim to nothing and everything. My words may be wisdom or disaster. In the end you make a choice. Noone is perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top