Solved

CFExecute fails but same code works from command line

Posted on 2004-09-03
12
1,087 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

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

Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
What You Need to Know when Searching for a Webhost Provider
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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