Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfexecute problem

Status
Not open for further replies.

keneck

Programmer
Nov 26, 2002
23
US
Hello,
I am using the <cfexecute> tag for the first time and I'm having trouble getting the correct result. I don't get any error message so figuring out what I'm doing wrong has been more than difficult. We are running CFMX 7.0 on Windows 2003.

We have a batch file for encrypting an xml file that works fine from the command prompt. However, we need this file to execute from a CF page. The code looks like the item below:

<cfexecute name = "D:\inetpub\arguments = #arguments#
outputFile = "D:\inetpub\timeout = "5">
</cfexecute>

The arguments include the ecryption key to use and the name of the file to encrypt. Both the key and the file name are correct when I output those values.

The end result of this process is that the encrypted file is created and has the correct name (e.g. myfile.xml.pgp, but it contains no encryption information - i.e., it is basically an empty file and useless.

I don't know if this is a ColdFusion problem or not. Since the batch file runs okay on its own, I'm figuring it is the <cfexecute> that is at fault. Since there is no error message and the batch file produces an output file rather than failing as it would if passed an incorrect encryption key or a non-existent xml file to encrypt, I am at a loss to know where to start to try and fix this problem.

I've seen lots of other posts about <cfexecute> problems that seem similar to this one, but none of the suggested solutions have any effect on this one or they don't seem to apply. Changing the timeout value has no effect. Checking server permissions doesn't show any problems, etc.

Any suggestions about where to look next would be appreciated. Thanks.
 
it's unfortunately a bug with cfexecute. it will not run all the time and yet not throw any error messages. i would suggest creating another batch file that will include the encryption key and the file name. then, use cfexecute to run that file which in return will do the encryption. i run into the same problem when i used GnuPG/PGP.

hope it helps...

 
Thanks for the response Falconseye. Unfortunately, we've already tried that. We took values of the key name and file name and hard coded them into a batch file that then called the encryption batch file and passed those values as arguments to the encryption process. Then we used <cfexecute> to run the first batch file (without passing any arguments since they were already in the batch file being executed). Ended up with the same result, an emtpy file. I suppose we could try that again just to make sure.

Appreciate learning that it is a true bug in <cfexecute>. Is this peculiar to PGP encryption batch files?

I think we are going to drop it for now and have the encryption done manually. "Automating" the process was going to be a nice convenience, but not worth putting a lot of time into it anymore.


 
i couldn't execute a gpg.exe with cfexecute. appearently, macromedia/adobe knows about this issue.
when you run the pgp to create the encrypted file with your public/private key, would it be possible that it's creating an empty file? the way i ended up doing is the exact same way you have described and it worked.

this is my gpg version of the batch file called mygpg.bat :

gpg -e -r XXXXXXXX myfile.txt

XXXXXXXX is my public key.

then i used

<cfexecute name="c:\..\mygpg.bat" variable="myVar" timeout="60"></cfexecute>

could you please try this and see if it works?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top