in reply to Unable to run batch file in CGI Script

When i use, system('C:/Server/Apache/cgi-bin/test.bat') == -1 or print "Error: $!\n";

The error log file has "Wed Sep 23 20:44:11 2009 error client 4.33.33.177 Wed Sep 23 20:44:11 2009 Run_Another_Prog_from_perl.cgi: Can't spawn "cmd.exe": No such file or directory at C:/Server/Apache/cgi-bin/Run_Another_Prog_from_perl.cgi line 15. ".


I copy and pasted cmd.exe in both htdocs and cgi-bin folder but it's still not working.
  • Comment on Re: Unable to run batch file in CGI Script

Replies are listed 'Best First'.
Re^2: Unable to run batch file in CGI Script
by VinsWorldcom (Prior) on Sep 23, 2009 at 15:22 UTC

    What version of Windows - Server 2003?

    This is *very* similar to the problem I described with IIS - CMD.EXE was not allowed to run by the web server (in my case IIS) even if it resided in the CGI-BIN directory and had proper permissions (everyone - full permissions).

    Is this a test system - isolated from the outside world? Try running the Apache service as admin and see if that fixes it - if so, you're experiencing the same issue I was. Obviously running as admin is *NOT* the solution, but it may help diagnose the anomoly you're seeing.

      Firstly i am having Windows XP. Secondly, i have admin rights in the system and so Apache should also should have admin rights. Thirdly, the system is connected to internet.