Executes a ColdFusion developer-specified process on a server computer.
Extensibility tags, Flow-control tags
<cfexecute |
Note: You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys. |
cfcollection, cfindex, cfobject, cfreport, cfsearch, cfwddx
ColdFusion MX 6.1:
Attribute |
Req/Opt |
Default |
Description |
---|---|---|---|
name |
Required |
|
Absolute path of the application to execute.On Windows, specify an extension, for example, C:\myapp.exe. |
arguments |
Optional |
|
Command-line variables passed to application. If specified as string, it is processed as follows:
|
outputFile |
Optional |
|
File to which to direct program output. If no outputfile or variable attribute is specified, output is displayed on the page from which it was called. If not an absolute path (starting with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, which is returned by the GetTempDirectory function. |
errorFile | Optional | File in which to direct error output, if any exists. | |
timeout |
Optional |
0 |
Length of time, in seconds, that ColdFusion waits for output from the spawned program.
|
variable |
Optional |
|
Variable in which to put program output. If no outputfile or variable attribute is specified, output is displayed on page from which it was called. |
errorVariable | Optional | Variable in which to put error output, if any exists. |
Do not put other ColdFusion tags or functions between the start and end tags of cfexecute. You cannot nest cfexecute tags.
Throws the following exceptions:
<h3>cfexecute</h3> <p>This example executes the Windows 10 version of the netstat network monitoring program, and places its output in a file. <cfexecute name = "C:\Windows\System32\netstat.exe" arguments = "-e" outputFile = "C:\Temp\output.txt" timeout = "1"> </cfexecute>
Output (output.txt)
Interface Statistics
Received Sent
Bytes 3271307481 2593709042
Unicast packets 141249055 109054150
Non-unicast packets 36464445 3693230
Discards 5705 0
Errors 0 0
Unknown protocols 0
Sign in to your account