Discussion Locked

AS400 trigger an .exe on WinNT 4.0 servr

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm looking for ways to initiate the processing of a file on WinNT server just after it has been sent from an AS400. The file was sent via FTP.

1 reply

by mckaytech

There are a couple ways to accomplish this. One that has worked pretty well for me (especially when I know about what time the file will arrive) is to write a batch file like this:

:start
if exist d:\ftp\dir\file run something.exe else goto wait
goto end
:wait
sleep
goto start
:end

(I'm not sure the syntax is exactly right but you get the idea).

Then schedule this batch file to run shortly after the expected arrival of the FTP file using AT, WinAT or Task Scheduler. It will check for the file and run the executable if it finds it; otherwise it will pause for a little while then re-check.

paul

This discussion is closed to new replies.