Hello,
I have some questions about a script I found here that I have been using, this is the script:
@ftp -i -s:"%~f0"&GOTO:EOF <--- What does this line do?
open 31.359.58.107
test
test
!:--- FTP commands below here ---
ascii <--- Why use Ascii here? Is it depending on the files that I want to transfer? There are two more that I know of; Binary and Type, when should I use them?
cd BACKUP
put C:\Documents and Settings\####\".rtf" <-- How do I send files that have the ending .rtf?
disconnect
bye
I find the tutorials and the forums very useful and I am really grateful for this, trying to learn batch programming because it will certainly reduce the amount of time I am using on manual work.
Thank you for your time!
Best regards
Olle
Upload files on FTP
Moderator: DosItHelp
-
- Posts: 79
- Joined: 13 Dec 2010 10:32
Re: Upload files on FTP
@ftp -i -s:"%~f0"&GOTO:EOF ----> This basically calls the batch file (itself) as the FTP script.
Try using
you may have to mess with "prompt" command to automate
put C:\Documents and Settings\####\".rtf"
Try using
Code: Select all
mput C:\Documents and Settings\####\*.rtf
you may have to mess with "prompt" command to automate
-
- Posts: 319
- Joined: 12 May 2006 01:13
Re: Upload files on FTP
olle24 wrote:Hello,
I have some questions about a script I found here that I have been using, this is the script:
@ftp -i -s:"%~f0"&GOTO:EOF <--- What does this line do?
open 31.359.58.107
test
test
!:--- FTP commands below here ---
ascii <--- Why use Ascii here? Is it depending on the files that I want to transfer? There are two more that I know of; Binary and Type, when should I use them?
cd BACKUP
put C:\Documents and Settings\####\".rtf" <-- How do I send files that have the ending .rtf?
disconnect
bye
I find the tutorials and the forums very useful and I am really grateful for this, trying to learn batch programming because it will certainly reduce the amount of time I am using on manual work.
Thank you for your time!
Best regards
Olle
ascii is usually used for text files. For transferring binary files, for example Word document, or zip files, you use binary. And wrong, learning batch does not reduce the time on your manual work. It lacks a lot of things that useful programming language has, so you end up doing more , like creating workarounds, sometimes making your code inefficient. Try to learn a more productive tool, like vbscript/powershell if you are stuck on Windows. Or Perl/Python (2 more common scripting language). They are many times more useful than batch.