Skip to Content
avatar image
Former Member

Script not working from communication channel

Hello

I have written a script for deleting a file from a FTP based on a condition, like if temp exists then delete temp1.

To have a clear picture of my scenario, it works like this.

  • the file sender picks a file from a location it puts the file on a FTP location.

  • After the Receiver channel puts the file, it needs to check for the file temp in the same directory on FTP and

and if the file exists then delete temp1 .

The deletion part works when i run the script file directly but from the communication channel it doesn't work for me.

i have put the script file at a location on PI server but it is not working.

Is there a particular location where i need to put the script ?

Moreover in the script the condition part is also not working

I am writing down the script which i am using.

  • Open FTP server IP

username

pwd

cd path where file needs to be checked

IF EXIST temp

del temp1

quit.*

Please provide me with the steps which needs to followed for writing the scripts.

please provide me with some information regarding scripts.

My OS is windows NT.

Thanks

Karandeep Singh.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jun 21, 2011 at 03:40 AM

    When ever you run communication channel it is unable to idetify the path mentioned in Comunication channel.

    Copy your script in to PI application server FTP,then specify correct path in CC.

    Regards,

    Raj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 21, 2011 at 03:59 AM

    Hi,

    Mention your script in Run Operating System Command After Message Processing textbox.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 21, 2011 at 05:36 AM

    Hi Karandeep Singh,

    There is a small correction for the deletion part which is as follows

     
    
    if exist temp ( 
    
    @echo off 
    del temp1 
    ) 
    
    

    The echo off statement is optional but it will supress the commands to be displayed which the script is running.

    Now for running the script in from receiver communication channel there is an option called "Run operating system command after message processing" as already pointed out by Chandra Sekhar. Here you mention the absolute name of the script or batch file Thus you need to put something like this "c:\apps\a.bat"; .

    This should work. If not you can convert the bat file to exe file and replace the statement to something like this

    "c:\apps\a.exe"; . The way to convert from bat file to exe can be found in link given below

    [from BAT to EXE|http://www.computerhope.com/issues/ch000435.htm]

    Hope this solves your problem

    regards

    Anupam

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 21, 2011 at 07:35 PM

    thanks all for your valuable suggestions.

    If i run the script directly, it deletes the file but it doesn't work when it is called through channel

    i got a link where it is written that copy,del and rename doesn't work in windows script.

    it is not working even if i put the file on NFS and try to delete the file on the same location.

    thanks

    karandeep singh

    Add comment
    10|10000 characters needed characters exceeded