How to launch .exe pgm from within FTP to MS SQL server to proces uploaded files

Posted on 2011-04-27
Last Modified: 2013-12-09
I have a client that we are transferring order files to a MS SQL Server from IBM iSeries using FTP
Once the file transfers have completed, the client wants us to run a pgm that will process the uploaded files.
I have been unable to make the QUOTE cmd in FTP run the remote cmd. I have been reluctant to look at using
RUNRMTCMD since it opens up the Host system to incoming remote cmds.

The clients' vendor has suggested running an HTTP cmd but not sure how to launch that via FTP or
from within my CL pgm.

Any suggestions would be greatly appreciated.
Question by:miraclemaxnd
    LVL 38

    Expert Comment

    by:Aaron Tomosky
    You could make a batch file that checks the FTP folder and runs the command if the file is there. Schedule that to run every few min

    Author Comment

    They are using that method currently and they can't set the time between checks to be less than 1 miinute so that won't work which is why I am looking for a way to launch the .bat or .exe to run after I have uploaded my files.
    LVL 10

    Expert Comment

    Maybe we could improve the batch file they use to resolve this 1 minute limmitation.
    LVL 34

    Accepted Solution

    As far as I know the RCMD FTP verb (command) is not supported by the native Microsoft FTP servers.  So, if you connect FROM a MS box (FTP client) to an AS/400 (FTP server), you can use the RCMD verb to execute AS/400 commands on the AS/400 server, but you cannot do the reverse (AS/400 client to MS server).

    You'll need to use another mechanism to launch your program.  There are a lot of ways to do this.  Examples:

    you can load a Remote Command server onto the remote system.  IBM also provides an Incoming Remote Command service as part of IBM i Access.  You can use the RUNRMTCMD command to kick off remote commands on any box 9Linux, Windows, AS/400, etc.) that is running a compatible remote command service.  The downside is these services are not very secure.

    Another good method is to create or install a folder-monitoring tool.  One thing to note about file-monitoring solutions:  It is usually a good idea to FTP into a temporary folder (since transferring files can take time, and you don't want your program to process half of a file usually), and then as a last step use an FTP command to MOVE the file(s) into the monitored folder, since MOVEs are instantaneous if the files reside on the same volume.

    Another option is to use SSH.  This is a very secure, flexible mechanism.  First, you'll have to install and configure an SSH server on you Windows server, and you'll also have to configure SSH on your AS/400.  Then you can use QShell commands to remotely execute commands between the two systems:

    - Gary Patterson


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Samba is the de-facto standard program (or, more correctly: suite of programs) that UNIX and Linux systems use to share files with Microsoft Windows (and more recently, Mac OS-X) systems. Currently, there are 2 common versions of Samba available,…
    As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now