• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1227
  • Last Modified:

CFExecute fails but same code works from command line

I am trying to call a small conversion tool via cfexecute and it times out when I call it.  I have several tools that use cfexecute so I understand the basics and have even made some tricky ones work but this has me stumped, especially because it is so simple.

The code looks like this

<cfexecute name="C:\SCPDF\SolidConvertPDF.exe"  arguments=" /i inputfilename /o outputfilename" timeout="30">

When I run this I get a timeout.  If I cut and paste the code from the error message on the command line it works fine.  So, thinking that I might have a permission problem, I looked down all of those alleys with no success.  I did run across a posting somewhere that suggested putting this in a batch file, which I did.  It then looked like this:

<cfexecute name="C:\thetool.bat" arguments="inputfilename, outputfilename" timeout="30">
 
When I ran this I got the exact same thing, timed out in CF yet when I pasted the code from the error on the command line, it ran like a champ.  

I've tried moving the directory, installing the utility to the web server root, cffusion and any place else that I thought would work.  I also installed it in the directory of another utility that I have that runs fine so I don't think it's a directory permission thing.

Does anyone have any idea where to go with this?
0
jimc5240
Asked:
jimc5240
  • 5
  • 5
1 Solution
 
pinaldaveCommented:

<cfexecute name="cmd.exe"
     arguments='/c thetool.bat /i inputfilename /o outputfilename'
/>
0
 
pinaldaveCommented:
0
 
jimc5240Author Commented:
Thanks for the help but I still have a problem.  It's not timing out any more but it's not running either.  I further reduced the batch file and just calling sc.bat from the command line works.  So, I tried this without success:

 <cfexecute name="cmd.exe"
           arguments="/c c:\sc.bat"
           timeOut="20"></cfexecute>

It runs through this so fast that I began to belive it wasn't running anything.  So I made another batch file called test.bat that was simply "copy c:\afile.txt c:\bfile.txt"  and when I plug it in the cfexcute like this:

<cfexecute name="cmd.exe" arguments="/c test.bat">  (and lots of deviations)

It didn't run that either. It didn't fail, it just doesn't do anything.  And of course, if you run test.bat from the command line, it works just fine.  How can I find out what is going on?

Thanks
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
pinaldaveCommented:
let us see the example in the other thread..... pay attention to capitalized word PERL

<cfexecute name="cmd.exe"
     arguments='/c PERL "\Program Files\AWStats\tools\logresolvemerge.pl" \statsLogs\WS001_ex040902.log \statsLogs\WS002_ex040902.log > \statsLogs\merged\merge_ex040902.log'
/>

we need something like that in your example... like some kind of program name which will run your SolidConvertPDF.exe may be ... something like this....

<cfexecute name="cmd.exe"  arguments="SolidConvertPDF.exe /i inputfilename /o outputfilename" timeout="30">

if you can do something like that in dos prompt that it will directly recognize SolidConvertPDF.exe from command line and you do no thave to go to the directory folder ... it will sure work ... I promise.. you just need to set path ( how ? I do not know... i am CF guy only) .... or you bring that program to c:\ directly ... it will work...
Regards,
---Pinal
0
 
jimc5240Author Commented:
Okay, I fixed the path so that you can run the utility directly at the c prompt:  The cfexecute looks like this:

<cfexecute name="cmd.exe"
           arguments="/c perl SolidConverterPDF.exe /i convtest.pdf /o converted.rtf"
          timeOut="15"></cfexecute>

If I run the cfexecute above, I get an error that 'perl' is not a recognized command.

If I cut and paste SolidConverterPDF.exe /i convtest.pdf /o converted.rtf to the command line it runs.

If I put this on the command line it runs:
cmd.exe /c SolidConverterPDF.exe /i convtest.pdf /o converted.rtf

If I run it without the 'perl' in the agrugments line it times out.

First, what is the purpose of the 'perl' entry?  I would assume it sets a run environment somehow.

Second, how do I fix the perl execution error or is there another environment I can use like asp or something?

Thanks,
0
 
pinaldaveCommented:
hello,
PERL is in the previous example... not in your example...buddy... I said we need to use somethingl like that... you can not use perl here... i said we need to have something like that... in your example that is like solidconverterpdf.exe... and you need  to set path to that... not to perl... :(
anyway... you need to install perl if you want to use ... but once you install it will nto server purpose... i was just trying to show you that how other one is fixed...
as I mentioned in the my previoius example... you need to do something like this... and what is the error now...
<cfexecute name="cmd.exe"
           arguments="/c SolidConverterPDF.exe /i convtest.pdf /o converted.rtf"
          timeOut="15"></cfexecute>

if it is timeoutinmg may be it is not finishing the job in 15 sec or milisec
REgards,
---Pinal
0
 
jimc5240Author Commented:
I have set the environment path variable so that I can run the SolidConverterPDF.exe from almost anywhere, yet the cfexecute still times out.  My guess at this point is there is some quirk in SolidConverterPDF that is at odds with CF.  If you run this from the command line, it finishes in less than 1 second so I doubt that it is not finishing within 15 seconds.  I know what you're thinking, if it runs on the command line, it ought to run in CFExecute, but it doesn't.  I've had three other CF guys look at it and no one sees the problem so maybe there isn't one that is solvable.

If you want to try it yourself, go to www.soliddocuments.com and download the 15 day trial of SolidConverterPDF.  All it does is take a PDF and turn it into an rtf.
0
 
pinaldaveCommented:
okey ... i will try it on Tuesday when I will go to office.
As a last try just have this and let me know what goes on...
<cfexecute name="cmd.exe"
           arguments="/c SolidConverterPDF /i convtest.pdf /o converted.rtf"
          timeOut="15"></cfexecute>
0
 
jimc5240Author Commented:
Your example just times out.
0
 
INSDivision6Commented:
OK.  In my case, after downloading an evaluation version, I have a flash screen that requires register/proceed/cancel.  This is why, when using CFEXECUTE, it hangs up to time-out, because there is nobody to click the button.  I don't know whether there is an option to disable that thing or not.  I've just used your very first example.  When I run this replacement of CFEXECUTE:

http://www.cftagstore.com/tags/cfxexec.cfm

I was able switch the execution into interactive mode and, therefore, I can click that stupid button.  After that everything works.  I tried a small PDF and it is being converted into RTF just fine.  So, I suggest you download CFX_EXEC (see link above) and try it instead of CFEXECUTE to see what's going on in your case.
0
 
jimc5240Author Commented:
Okay, INSdivision6 had the answer in that I needed CFX_EXEC to do this however, according to the CFX_EXEC people, you do want to execute this directly and not via cmd.exe.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now