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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFEXECUTE Help!

Status
Not open for further replies.

BobLaw

Programmer
Oct 2, 2000
27
0
0
US
Hello,

I have an application called Contracts.exe made in VB that will edit a file and store a new copy on the server. The problem I am having is that the <CFEXECUTE> will not run the application. I have tried everything, if I make the path wrong I receive an error so I know it is looking for it. But using both methods below I receive no error the page completes but the application never runs. If you have any ideas please let me know, this is killing me.
The server is an NT 4.0 SP 6a, with CF 4.5 SP2.

This batch file will just run the Contracts.exe, I figured I would try it but both fail to work.

<CFEXECUTE NAME=&quot;E:\Legal\NDAS\cont.bat&quot; timeout=&quot;60&quot;></cfexecute>


<CFEXECUTE NAME=&quot;E:\Legal\NDAS\Contracts.exe&quot; timeout=&quot;60&quot;></cfexecute>

Thank you.
 
Have you tried running Contracts.exe simply from the commmand line to see what it does? - tleish
 
Yes, I can run the application on the server from the command line, or right click and open and it works fine. The problem is with using CFEXECUTE no errors come back but the application won't run. Any other thoughts?
 
Contracts.exe edits a file then stores a new copy on the server? How does it know which file to edit and where to store the new file? - tleish
 
The VB app I made reads a file that is generated by CF via a user form on the web. It then uses that information stored in the file nda.ini to copy a Word tmeplate over to a temp directory, look for fixed fields, replace those fields with the information stored in the nda.ini file and names the file NDA(this date and time).doc in a defined directory. This was the best way I could think of to edit a Word document without using automation. It works great as far as making the changes and saving the new file. The problem is that CFEXECUTE will not run the file on the server and returns no errors. I have also tried CFX_SpawnL, and the same problem, it returns no error but the app does not run. BTW, it seems to process a .bat file, but if I have the .bat file start the application it still will not run.

Please, anyone have any idea why cfexecute seems not to run an application?

Thanks again.
 
I ran into the same problem. It has to do with the NT Account that CF is running under. If CF is not running under the Administrator account, you're out of luck. For some reason, you can't run batch files under any other account, except the Administrator account. You can run executables all day long, but not batch files. You can get around this though by getting a utility that turns your .bat files into .exe or .com files. You should be good to go from there. Go to google and search for BAT2EXE

HTH
 
Thanks for that info.

Now I have another problem, it seems that the Contracts.exe application does start as a process, but quits without working after 5 seconds (watched the task manager using PCAnywhere to see it start and stop). Again, if I run that same application that I am calling from cfexecute manualy on the server it runs fine! But terminates before processing using the cfexecute tag. Any idea's on that one?
If I can only get this problem solved the application would be ready to go.
 
Update, I have it working now!!

I had to modify the Contracts.exe code, funny how it would work fine running from the run command on the server but error out being called by cfexecute. After adding more error handling and msgbox's I was able to see an error 20 was occuring (but not reported by fxexecute). I changed away from using the UNC paths and it all works fine now.
If anyone wants the VB/CF code I am using just send me an e-mail. The reason I went this path was for users to fill out a form on the web with information, that is then added to defined fields in a Word document, the document is named with the title then date and time, and send off to the legal department via e-mail.
They did not want the field people to have to update the document and e-mail it. This way they do not have to have MS Office or MS Word installed to do these changes.

Well, thanks again for trying to help me out.



 
BobLaw,

I've been trying to do the same thing to no avail.

How do I find your email address so that I can request the code?

Thanks
rr236
 
Opp's :)
use boblaw@ourfun.com

I am going to clean it up and add more comments. So send me an e-mail and I will zip up the files and send them out by the end of this weekend.

So you know the new system is live and working great right now. I cannot send the acutal word template (legal reasons) so I will make a dummy one that will function to go by.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top