Hello, i need a .bat file that sends a file from my computer to my ftp.
Could someone write here what i should write in nootepad if i for example need to
upload this file: c:\Program Files\testfile.txt
to my ftp: e.g. ftp.drivers.dr.funpic.org to directory "main" (on my ftp)
if my username is: e.g. master
if my password is: e.g. master0000
sry for my english..
thx
FTP transfer with .bat file
Moderator: DosItHelp
xxxxxx,
DosItHelp?
Code: Select all
@ftp -i -s:"%~f0"&GOTO:EOF
open ftp.drivers.dr.funpic.org
master
master0000
!:--- FTP commands below here ---
ascii
cd main
put "c:\Program Files\testfile.txt"
disconnect
bye
DosItHelp?
it doesn't work, but i found this...http://support.microsoft.com/?scid=kb%3 ... &x=17&y=19 and this works....thank for your reply anyway
xxxxxx,
Copy the code from my erlier post into notepad, save as "myftp.cmd" and then run "myftp.cmd" from command line or from explorer.
This is a single file solution where the FTP script is embedded within the batch.
I tried it and got the following output:
Let me know if it works for you or send your output to the forum, I would like to see what's wrong.
Thanks,
DosItHelp
Copy the code from my erlier post into notepad, save as "myftp.cmd" and then run "myftp.cmd" from command line or from explorer.
This is a single file solution where the FTP script is embedded within the batch.
I tried it and got the following output:
C:\Documents and Settings\Dostips>myftp.cmd
ftp> @ftp -i -s:"%~f0"&GOTO:EOF
Invalid command.
ftp> open cmdtips.com
Connected to cmdtips.com.
220 Dot5Hosting FTP Server ready
User (cmdtips.com:(none)):
331 Password required for usr
230 User usr logged in
ftp> !:--- FTP commands below here ---
ftp> ascii
200 Type set to A
ftp> cd main
250 CWD command successful
ftp> put "c:\Program Files\testfile.txt"
200 PORT command successful
150 Opening ASCII mode data connection for testfile.txt
226 Transfer complete
ftp> disconnect
221 Goodbye.
ftp> bye
Let me know if it works for you or send your output to the forum, I would like to see what's wrong.
Thanks,
DosItHelp
-
- Posts: 6
- Joined: 17 Jun 2009 20:17
- Location: http://vietdzung.net
- Contact:
Tks, this topic is helful,
But, i want to loop it daily :
If system_date=DD then send "c:\rpt\fileDDMMYY.xyz"
E.x: If system_date=30 send "c:\rpt\file30MMYY.xyz"
I need the correct cmd or batch file now, Plz help me ...
Code: Select all
@ftp -i -s:"%~f0"&GOTO:EOF
open 10.20.30.40
abc123
abc
!:--- FTP commands below here ---
ascii
cd receive
send "c:\rpt\fileDDMMYY.xyz"
disconnect
bye
But, i want to loop it daily :
If system_date=DD then send "c:\rpt\fileDDMMYY.xyz"
E.x: If system_date=30 send "c:\rpt\file30MMYY.xyz"
I need the correct cmd or batch file now, Plz help me ...