cancel
Showing results for 
Search instead for 
Did you mean: 

File import with OS command on FTP receiver adapter

Former Member
0 Kudos

Hi gurus,

I would like to write a script ("Run OS command before Message Processing")for importing a file from a FTP based on a condition, like if file_a.txt does not exist on folder RECEIVE/TXT than import file_a.txt from location IMPORT/TXT to RECEIVE/TXT.

please provide me with some information regarding this issue.

My OS is windows NT.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member854360
Active Contributor
0 Kudos

Hi Peter,

This will work for you

copy /-y \IMPORT\TXT\file_a.txt \RECEIVE\TXT

if file_a.txt exist in \RECEIVE\TXT folder then it will not copy the file otherwise it wll copy the file.

Here -y does the workk for you

http://malektips.com/xp_dos_0016.html

Answers (1)

Answers (1)

Former Member
0 Kudos

any updates?

Former Member
0 Kudos

If I don't understood wrong, the script can be something like follow:


set filename=text.txt

cd /directory1/

   IF EXIST %filename% (
        # FTP 2
        ftp <serverdest_1>
        mput %filename%
    ) ELSE (
        cd /directory2/
        # FTP 2
        FTP <serverdest_2>
        MPUT %filename%

    )