|
Of course to do FTP from the PC to the 400 without storing your password in a text file you could build the text file on the fly! The only problem then is that when you type in your password it is displayed on the screen. Of course you could make the password the last thing you type in which would cut down on the time that it would be displayed. Create a .bat file with a name like ftpas400.bat or similar and add this code below. Then on a PC command line type the name of the batch file. If remote commands are enabled you could add processing or send yourself or someone a message when the job was run or...etc. Here's the code: @echo off rem - this command builds an ftp script file and then runs it. rem - the ftp script file updates a file on the as400 rem - Bill Meecham 8/10/2001 rem _____________________________________________________________ rem - Required Parameters: USERPROFILE PASSWORD FILENAME TARGETFILE rem _____________________________________________________________ rem - clear the screen to remove the user name and password as soon as possible & handle errors rem _____________________________________________________________ cls if "%1" == "" goto cmdHelp if "%1" == "-" goto cmdHelp if "%1" == "?" goto cmdHelp if "%2" == "" goto cmdHelp if "%3" == "" goto cmdHelp if "%4" == "" goto cmdHelp rem - start building the ftp script file rem _____________________________________________________________ @echo prompt >> ftp.ftp @echo verbose >> ftp.ftp @echo open 10.1.254.25 >> ftp.ftp @echo user %1 %2 >> ftp.ftp @echo put %3 %4 >> ftp.ftp @echo quit >> ftp.ftp rem _____________________________________________________________ rem - run the ftp script file ftp -n -s:ftpexchange.ftp rem _____________________________________________________________ rem - remove the script file! del ftp.ftp goto exit rem _____________________________________________________________ :cmdHelp echo -------------------------------------------------------------- echo ftp2iSeries command: echo This command is used to transfer a file echo from the PC to the AS400. echo -------------------------------------------------------------- echo Command syntax: echo ftpExchange USERNAME PASSWORD FILENAME AS400FILE echo -------------------------------------------------------------- echo USERNAME - The AS400 user name. echo PASSWORD - The AS400 password for the user name. echo FILENAME - The name of the CSV file that you have echo created on the PC. Enter the full file name echo including the extension. echo Ex. c:\myDirectory\assoc.csv echo AS400FILE - The name of the as400 file that you want to echo load the data to. echo Enter the full file name echo Ex. /qsys.lib/xmtest.lib/myFile.file/myMbr.mbr echo Additional help - Contact MIS department. echo Bill Meecham echo -------------------------------------------------------------- pause rem cls rem _____________________________________________________________ :exit
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.