Solved

CFExecute fails but same code works from command line

Posted on 2004-09-03
12
1,039 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
12 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
 
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 500 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now