> -----Original Message----- > From: Yogesh Mahajan [mailto:[EMAIL PROTECTED] > Sent: Friday, September 07, 2007 5:52 AM > To: IBM-MAIN@BAMA.UA.EDU > Subject: Re: COMMAND SHELL PROGRAMMING. > > This could be done by REXX/ CList. > > But if you wish to do write FTP script on client receiving the file, you > may write a DOS shell script (.bat) like this: > ========================================================================== > REM Get user's input - Mainframe IP, FTP ID, Pwd etc... > REM Create downloading script, execute it (ftp) and delete it. > REM > SET strMember='%strInputFileNameFromUser%' > >script.ftp ECHO USER %strUser% > >>script.ftp ECHO %strPwd% > >>script.ftp ECHO prompt n > echo Downloading the file: %strMember% TO %strSProc% > >>script.ftp ECHO get %strMember% %strSProc% > >>script.ftp ECHO bye > ftp -n -s:script.ftp %strMainframe% > TYPE NUL >script.ftp > NOTEPAD %strSProc% > ==========================================================================
Is anyone besides me surprised at the syntax of this "bat" file? ISTR "bat" scripts had to have the ">filename" or ">>filename" command output redirections placed AFTER the command whose output you wanted to capture. I.E., "ECHO prompt n >>script.ftp", not ">>script.ftp ECHO prompt n". Apparently M$ changed the rules when I wasn't looking any more. I tried this script (with appropriate changes) and it actually works, at least on my WinXP/SP2 system. Peter This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html