Thanks to both of you.When i tried to print out @cmd, It was printing them out, but I can't understand why, was not substituting the actual values of $file.Since I din't have an actual file called $file, it was trowing me an error.Once I changed it as @ options etc, it succeeds, atleast from my side.I just need to go on to the as400 to see if it has recieved the files