我使用ColdFusion的cfexecute运行以下命令:composite -geometry +2+2 "C:\Inetpub\wwwroot\isubscribe_uk\diomedes\www\images\newsletter\316\resized.png" "C:\Inetpub\wwwroot\isubscribe_uk\diomedes\www\images\newsletter\templateImages\isubscribe\blank.png" "C:\Inetpub\wwwroot\isubscribe_uk\diomedes\www\images\newsletter\316\part1.png"
<cffunction name="executeWrap" returntype="string">
<cfargument name="commandToRun" type="string" required="Yes">
<cfargument name="cmdArg" type="string" required="Yes">
<cfset var result = "">
<cfexecute name="#arguments.commandToRun#" arguments="#arguments.cmdArg#"
variable="result" timeout="15" />
<!--- <cfdump var="#arguments#">
<cfdump var="#result#"> --->
<cfreturn result>
</cffunction>由于某种原因,上面的东西不起作用。不过,当我直接在命令提示符上运行该命令时,它就可以工作了。
有什么想法吗?
发布于 2014-02-18 03:24:55
CFExecute忽略被调用进程发送给标准错误的任何内容。为了能够查看是否生成了任何错误输出,请将"errorVariable“参数添加到cfexecute调用中,然后检查其中是否有错误输出,并让脚本做出相应的反应。
<cfexecute name="..command to run..."
arguments='.. your arguments...'
variable="results"
errorVariable="errorOuptut"
></cfexecute>
<cfif len(errorOuptut)>
<cfthrow message="#errorOuptut#" />
</cfif>更多信息请点击此处:http://www.raymondcamden.com/index.cfm/2008/4/9/ColdFusion-801-change-to-CFEXECUTE
https://stackoverflow.com/questions/17452919
复制相似问题