• Home
  • More…
  • Archives
  • About…

NUKLEOS weblog

Virtual Memory (Resurrected)

Feeds:
Posts
Comments
« Aliens In Our Garden!
Reconnected To LinkedIn… »

Did You Wait For The Output Of <cfexecute> in ColdFusion?

11/11/2019 by Wouter

So you’re developing a ColdFusion application and you need to access the output of a Windows program, like ‘netstat.exe‘ to take the example from the Adobe documentation?

The documentation on how to do that is relatively complete, but fails to emphasise an important point. Try this, and you’ll see… nothing, no output:

<cfexecute name="C:/Windows..../netstat.exe" variable="output" />
<cfdump var="#output#" />

The important point is that you really need to specify a non-zero ‘timeout‘ argument if want to capture the output of the Windows tool in a variable. Simple, but yes: this one had me stumped for 90 seconds!

<cfexecute name="C:/Windows..../netstat.exe" variable="output" timeout="1" >
<cfdump var="#output#" />

If you forget that ‘timeout‘ argument the command you issue will execute, but you won’t know its output, since ColdFusion is already further along in its execution. You may have to experiment a bit with the value for the timeout, depending on the specifics of the machine you’re running ColdFusion on and the execution time of the command called (obviously). Not specifying the timeout will launch the command, but it won’t wait for the command to end – which can be useful as well – but not always.

Share this:

  • Twitter
  • LinkedIn
  • Email

Like this:

Like Loading...

Related

Posted in ColdFusion, Software Development |

  • My Activity

    November 2019
    M T W T F S S
     123
    45678910
    11121314151617
    18192021222324
    252627282930  
    « Oct   Dec »
  • My Favourites

    • Ars Technica
    • bvlg.blogspot.com
    • ColdFusion Bloggers
    • Digital Photography Review
    • George Monbiot
    • Heise News Ticker
    • Jamie Todd Rubin
    • Jon Udell
    • Planet Python
    • Scripting.com
    • Seth Gottliebs Blog
    • The Electronic Intifada
  • My Sites

    • Innologos
    • My photos (Flickr)
    • N U K L E O S
  • On Probation

    • Artima Weblogs
    • Ruby Inside
    • The Cult Of Mac
    • The Unofficial Apple Weblog
  • My Categories

    Android Apple & Macintosh ColdFusion Content Management Design and Art Internet Java Linkrot! Linux Literature Mobile Computing Motorcycles Music Patents, IP, Privacy and More PDA Personal Photography Privacy and Security Python R1100S Ruby Science Social Media Society Software Software Development Technology Ubuntu Web Development Wiki
  • My Photos on Flickr

    P1020834P1020823P1020479
    More Photos

Blog at WordPress.com.

WPThemes.


loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
%d bloggers like this: