Executes a ColdFusion developer-specified process on a server computer.
Extensibility tags, Flow-control tags
<cfexecute
name = "application name"
arguments = "command line arguments"
outputFile = "output filename"
timeout = "timeout interval"
variable = "variable name">
...
</cfexecute>
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.ColdFusion MX 6.1:
Added the variable attribute.
Changed filepath behavior for the outputFile attribute:
if you do not specify an absolute filepath in the outputFile attribute,
the path is relative to the ColdFusion temporary directory.
Attribute |
Req/Opt |
Default |
Description |
|---|---|---|---|
|
Required |
Absolute path of the application to execute. On Windows, specify an extension, for example, C:\myapp.exe. |
|
|
Optional |
Command-line variables passed to application. If specified as string, it is processed as follows:
If passed as array, it is processed as follows:
|
|
|
Optional |
File to which to direct program output.
If no 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 |
|
|
Optional |
0 |
Length of time, in seconds, that ColdFusion waits for output from the spawned program.
If the value is 0:
|
|
Optional |
Variable in which to put program output.
If no |
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:
If the application name is not found: java.io.IOException
If the effective user of the ColdFusion executing thread does not have permissions to execute the process: a security exception
The time-out values must be between zero and the longest time-out value supported by the operating system.
<h3>cfexecute</h3>
<p>This example executes the Windows NT version of the netstat network monitoring program, and places its output in a file.
<cfexecute name = "C:\WinNT\System32\netstat.exe"
arguments = "-e"
outputFile = "C:\Temp\output.txt"
timeout = "1">
</cfexecute>