Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: FTP command -without user interaction
What OS?
Since you say "batch" file I will presume Windows.
Use the "-s:filename" parameter and pass a scriptfile to the ftp command You can generate the scriptfile on the fly with echo commands and ">>" symbol redirection:
eg:
echo verbose off> %ftp_tfile%
echo open %ftp_tgt_node%>> %ftp_tfile%
echo %ftp_tgt_user%>> %ftp_tfile%
echo %ftp_tgt_pwd%>> %ftp_tfile%
echo type ascii>> %ftp_tfile%
echo cd %3>> %ftp_tfile%
echo put %1%2>> %ftp_tfile%
echo bye>> %ftp_tfile%
rem Do the actual ftp using this script file rem TYPE %ftp_tfile%
Example:
C:\Temp>type ftpscript.ftp
open mynode
username
secretpassword
type ascii
cd sys$login
get login.com
bye
C:\Temp>ftp -s:ftpscript.ftp
ftp> open mynode
Connected to mynode.
220 mynode FTP Server (Version V4.1-12) Ready.
User (mynode:(none)):
331 Username USERNAME requires a Password.
230 User logged in.
ftp>
ftp> type ascii
200 TYPE set to ASCII.
ftp> cd sys$login
250 CWD command succesful.
ftp> get login.com
200 PORT command successful.
150 Opening data connection for login.com (a.b.c.d,2828)
226 Transfer complete.
ftp: 1570 bytes received in 0.20Seconds 7.85Kbytes/sec.
ftp> bye
221 Goodbye.
C:\Temp>
HTH,
Bruce Reardon
-----Original Message-----
Sent: Friday, 4 July 2003 4:09 PM
Hi All,
How to execute FTP command without interaction. Basically i want to supply hostname,username,passwors,filename thru batch script.
For example
ftp hostname userName passWord fileName
Could someone help me to do the same?
Thanks
Sami
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Reardon, Bruce (CALBBAY)
INET: Bruce.Reardon_at_comalco.riotinto.com.au
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Jul 04 2003 - 01:29:24 CDT
![]() |
![]() |