运行一个服务器上ColdFusion开发者指定的程序。
<cfexecute
name = "application name"
arguments = "command line arguments"
outputFile = "output filename"
timeout = "timeout interval"
variable = "variable name">
...
</cfexecute>
|
属性 |
必选/可选 |
默认 |
描述 |
|---|---|---|---|
|
name |
必选 |
|
要处理的应用程序的绝对路径。 Windows系统上, 你必须指定一个应用程序的扩展名,比如说,C:\myapp.exe。 |
|
arguments |
可选 |
|
命名行变量传递给应用程序。如果指定为一个字符串,它就如下运行:
如果使用一个数组作为参数,它会按照如下方式运行:
|
|
outputFile |
可选 |
|
执行应用程序后直接输出的文件。如果没有指定 outputfile 或 变量属性,输出结果显示在被调用的网页上。 如果不是绝对路径(以一个盘符和冒号,或者是一个斜线或反斜线作为开始字符),它与ColdFusion的临时目录相关,临时目录是通过GetTempDirectory 函数返回。 |
|
timeout |
可选 |
0 |
时间的长度,以秒为单位,ColdFusion 等待输出结果的程序响应时间。
默认值是零:
|
|
变量
|
可选 |
|
程序输出时的变量。如果没有 outputfile 或者 变量属性是指定的,那么输出就会被显示在调用的网页上。 |
不要把其他的ColdFusion标签或者函数放在cfexecute的开始和结束标签之间。你不能层叠套用 cfexecute 标签。.
该标签会抛出下面的例外信息:
超时时间的值必须在0和当前作业系统提供的最长的超时时间值之间。
<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>