Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a Windows executable in a CGI script 1

Status
Not open for further replies.

anpfire

Programmer
Oct 8, 2003
22
CA
Hi,
I'm new to CGI. I am running some CGI scripts on an Apache server, which is on a Windows machine. Is it possible to run a Windows EXE file (which takes command-line arguments) within a CGI script and will be run server-side?
I appreciate any help you can give me. Thanks.
 
Yes. The CGI runs on the server so if you make a system call from CGI, it also runs on the server. How you do that depends on your language, but most of the time, it's just system("program.exe")

________________________________________
Andrew
 
I am writing the CGI script in Perl.
I tried: system('C:/temp/program.exe');
And the browser just keeps loading the webpage (that is created by the CGI script), but never actually loads it. And no errors are reported by the Apache server.
Do you know whether the server needs to be configured to allow EXEs to be run?
 
This has been answered in the Perl forum.

As regards no errors, that's because there probably aren't any errors that occur which the webserver picks up. If you post some code, there may be a glitch in logic, of how you anticipate things to work, versus how stuff actually happens.

If I get a ticket for Arkansas when I really wanted to go to Alaska, I've got a ticket, and can board a plane, but where's the error, if you see what I mean. Yes there is a foul-up, but as far as the systems are concerned everyone's happy, if that makes sense

HTH
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ... smack the fecker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top