Since I have no idea what fasta34.exe does, it's difficult to know where the problem might be. That being said, I do notice one thing about your code that might be causing it problems: the file
has not been closed when you pass it to fasta34.exe as a parameter and the exe may not be able to work with files that are already open. Try closing it first and see what happens.