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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running an executable from a perl cgi

Status
Not open for further replies.

stfaprc

Programmer
Joined
Feb 10, 2005
Messages
216
Location
US
We are in the midst of attempting to get a perl script to run an executable when it is running via a browser.

we have tried system() and open (IN,"|-") || exec

in both cases we get an error message about being unable to spawn cmd.exe (this is running on IIS4) .
When I put the executable in the cgi-bin directory,
the exe will start but that is all it does. The only way that I know it started is that it shows in the 'Task Manager', where it stays until reboot since I can't terminate it.
 
I normally use backticks if you are wanting it to block (wait till it is done executing to continue)..

Like


$output = `c:/test.exe`;
print "Output from script is $output\n";


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
ok, that seems to have stopped the problem of the exe staying in memory. but it still did not actually run,
still have the error that cmd.exe can not spawn.
 
check that you are passing the full path to you output.

I.e. don't pass `test.pl` but `/path/to/file/test.pl`;



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top