ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

How to spawn .exe with parameters w/o requiring php/perl using windows cmd interpreter #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to come up with a mechanism which will allow me launch a 
windows executable and pass it paramters. While this is not unusual, and 
no problem via a CGI script, I have a constraint on a particular system 
where I can't install perl, php, python, or basically anything else.  
(Government site, they don't want anything to touch registry, no DLLs, 
basically I can use compiled mongoose binary + either a .VBS or .CMD script
(s) & shtml/html files. -- one of those controlled systems that just can't 
tolerate one of the standard cgi interpreters)

With that in mind, is there a mechanism I can use to pass parameters to a 
CGI program that just calls cmd to do the HTML encapsulation? 

---------------------------------------------
test.cmd CONTENTS (The %1 is input parameter)
#!c:\windows\system32\cmd.exe
@echo off
echo Content-Type: text/html
echo.

echo ^<HTML^><BODY^>
#below proves something came back
set 
# below is what I really want to do
#start MyProgram.exe %1
echo ^<BODY^>^<HTML^>

----------
mongoose.conf
cgi_ext bat,cmd,exe
cgi_interp c:\windows\system32\cmd.exe

===   INDEX.HTML ===
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD> <TITLE>Text submission</TITLE>
</HEAD><BODY><P>Please press submit</P>
<FORM ACTION="test.cmd" METHOD="POST">
<INPUT TYPE="TEXT" NAME="ParmList" VALUE="ParmValue">
<INPUT TYPE="SUBMIT" NAME="textsubmit" VALUE="Submit Text">
</FORM></BODY></HTML>

When I try combination above (also tried test.bat) .. firebug indicates 
that no POST attempt is taking place.  However, once I click the submit 
button, the windows task manager says another instance of cmd is now 
running.

This should be relatively straightforward, unless I am missing something 
obvious or there is a bug.   (Note, I am using latest CVS built as of the 
time of this posting)..

Original issue reported on code.google.com by dlethe3...@gmail.com on 3 Apr 2009 at 3:51

GoogleCodeExporter commented 9 years ago
It would be better if you ask this question in the mailing list - someone may 
have
better ideas on that that I may do.

Original comment by valenok on 3 Apr 2009 at 1:18

GoogleCodeExporter commented 9 years ago
Closing this.
I believe I have answered this on mailing list.

Original comment by valenok on 9 May 2009 at 7:44