Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFExecute fails but same code works from command line

Posted on 2004-09-03
12
Medium Priority
?
1,139 Views
Last Modified: 2013-12-24
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
Comment
Question by:jimc5240
  • 5
  • 5
11 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 11976670

<cfexecute name="cmd.exe"
     arguments='/c thetool.bat /i inputfilename /o outputfilename'
/>
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11976693
0
 

Author Comment

by:jimc5240
ID: 11981554
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 21

Expert Comment

by:pinaldave
ID: 11981828
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
 

Author Comment

by:jimc5240
ID: 11984041
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
 
LVL 21

Expert Comment

by:pinaldave
ID: 11984465
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
 

Author Comment

by:jimc5240
ID: 11985406
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
 
LVL 21

Expert Comment

by:pinaldave
ID: 11985757
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
 

Author Comment

by:jimc5240
ID: 11986105
Your example just times out.
0
 
LVL 7

Accepted Solution

by:
INSDivision6 earned 1500 total points
ID: 11993166
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
 

Author Comment

by:jimc5240
ID: 12192563
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

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question