Solved

Problem With cfexecute

Posted on 2001-07-05
8
674 Views
Last Modified: 2013-12-24
I've tried implementing a piece of code offered as a comment by cf_spike in a previous question by another user

the code is <CFEXECUTE ARGUMENTS="c:\website\htdocs\test.cfm testvar=hello" NAME="c:\cfusion\bin\cfml.exe" TIMEOUT="1"/>

the template test.cfm merely tries to output the variable testvar.
I didn't try to output it with any scope as I was not sure if it would be url or maybe form.

The problem is that the template does not recognise the variable. I suspect it may be the way the arguments atribute is formed, but I don't seem able to get the correct syntax.
0
Comment
Question by:jamathon
[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
  • 4
  • 4
8 Comments
 
LVL 4

Expert Comment

by:CF_Spike
ID: 6257423
Depending on which version of ColdFusion Server you are using the code above may or may not work. It should work in CF 5.0, but may fail in previous versions.

You could try passing the arguments as an array to the cfexecute tag instead:

<CFSET myArray = ArrayNew(1)>
<CFSET myArray[1] = "c:\website\htdocs\test.cfm">
<CFSET myArray[2] = "testvar=hello">
<CFEXECUTE ARGUMENTS="#myarray#" NAME="c:\cfusion\bin\cfml.exe" TIMEOUT="5"/>

The variable is passed in the url scope.

Spike

0
 
LVL 2

Author Comment

by:jamathon
ID: 6257463
I'm running 4.5, it can't seem to pick it up even when I use the array. I had the debugger on to see if any variables were present, and they weren't.

It's not urgent, as I was just interested after seeing your comment on the previous question.
I'll have to wait unti I load cf5
Cheers
0
 
LVL 4

Expert Comment

by:CF_Spike
ID: 6257481
Try running the command from the command line to see if it works.

I have done this in CF 4.5x

Spike
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 2

Author Comment

by:jamathon
ID: 6257664
I tried c:\cfusion\bin\cfml.exe c:\website\htdocs\test.cfm testvar=hello from a command line

I also tried wrapping testvar=hello in quotes.

neither seemed to work.

any chance of sending me cfml.exe to try from cf5 (It looks like there are 2 associated files in the cfusion\bin.

Thanks
James
0
 
LVL 4

Expert Comment

by:CF_Spike
ID: 6258573
Before I do that,

Can you post the code for test.cfm?

Spike
0
 
LVL 2

Author Comment

by:jamathon
ID: 6258859
I starte out with <cfoutput>#testvar#</cfoutput>.

I then left it as a blank template with the debugger on.
0
 
LVL 4

Accepted Solution

by:
CF_Spike earned 100 total points
ID: 6258866
I can't see anything wrong with that.

what's your email address?

Spike
0
 
LVL 2

Author Comment

by:jamathon
ID: 6259053
james@hard2forget.co.uk

Cheers
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

623 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