Why does cfexecute return [empty string]?

477 Views Asked by At

I'm new to ColdFusion so please forgive me if I'm asking an obvious question.

I'm trying to run a simple code, which I've found somewhere to test if cfexecute works or not.

<cfexecute name="netstat" variable="result" timeout=10 />
<cfdump var="#result#">

The above code return [empty string], or if I try to write it into a file it just creates an empty file.

I've also tried to ping a server, what I can do from command line.

What I've noticed is that the page gets generated immediately instead of waiting for the timeout in case it would fail.

Also what is important to note: the code works sometimes, without changing anything.

Is it possible that there is a limitation on how many programs can ColdFusion execute?

Thanks for the help!

Solution: I had too many executions that did not terminate themselves automatically. That did not allow ColdFusion to open a new one.

1

There are 1 best solutions below

6
On BEST ANSWER

The issue is due to low timeout value. Execution of netstat command takes time. Try increasing it to 100 or more. I also experienced same issue. Increasing the timeout value solves the issue.

Note: as @beginner suggested you need to provide Absolute path of the executable to execute, in case the path is not added to your environment variable or default app folders (where os looks for the files by default). In case the path is available in environment variable or app folders you can just provide name too.