Ver Mensaje Individual
  #6 (permalink)  
Antiguo 10/09/2006, 10:35
sqa212
 
Fecha de Ingreso: mayo-2003
Mensajes: 866
Antigüedad: 21 años
Puntos: 0
He conseguido por fin ejecutar el archivo exe en el localhost y pasarle el archivo txt.

<%
programa="programa1"
archivo="probando.txt"
rutaprograma=server.MapPath(".") & "\" & programa
rutayarchivo=server.MapPath(".") & "\" & archivo
sExecStr = rutaprograma & " " & rutayarchivo
Response.Write sExecStr &"<br>"
Set oShell = Server.CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sExecStr)

Do While oExec.Status = 0
Response.Write "Esperando oExec.Status " & oExec.Status &"<br>"
Loop
Response.Write "<b>oExec.Status " & oExec.Status &"</b><br>"

Do While Not oExec.Stdout.atEndOfStream
tmpStr = oExec.StdOut.Read(1)
if tmpStr = Chr(13) then tmpStr = "<BR>" & tmpStr
Response.Write tmpStr
Response.Flush()
Loop

RetCode = oExec.stderr.readall
Response.Write RetCode
Response.Write "<br>oExec.Status " & oExec.Status
%>


Esto es lo que me arroja:

INPUT:
1) "c:\inetpub\wwwroot\webexe\probando.txt" (ASC file)
OUTPUT:
1) "c:\inetpub\wwwroot\webexe\probando.inc"
2) "c:\inetpub\wwwroot\webexe\probando.bmp"
Error, could not open output file

En realidad deberia aparecer: (es lo que ocure cuando uso la linea de comandos)
Creating file "c:\inetpub\wwwroot\webexe\probando.bmp"
1 archivos copiados.


A ver si alguien me aclara un poco que ocurre y si ahi solucion pra esto, estoy empezando a pensar que quizas no es posible lo que intento hacer.
Mezcla de emociones!
Contento por conseguir ejecutar el programa y triste por que no funcione.