in reply to Executing windows batch files via System

This is almost certainly a "permissions thing".

By default, webservers run under accounts that have severely restricted permissions, which is probably preventing the script from working.

Beyond that, allowing people to invoke a script on your server, via a web page seems like a really dumb idea to me.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: Executing windows batch files via System

Replies are listed 'Best First'.
Re^2: Executing windows batch files via System
by glasswalk3r (Friar) on Apr 26, 2007 at 13:13 UTC

    I agree. Anyway, what the DOS batch file is doing anyway? I doubt you couldn't rewrite the functionality (even if you're going to use system()) in some parts) using Perl code.

    If you're using ActivePerl, my suggestion is that you take a look at the module Win32::Process and see if it's not a better option for the problem.

    Alceu Rodrigues de Freitas Junior
    ---------------------------------
    "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

      What makes you think that using Win32::Process will make the slightest bit of difference?

      1. system 1, ... maps directly to the api CreateProcess() which is exactly what Win32::Process does.
      2. If the batch file fails when run under ther web server account, trying to do those same things, from within perl under the web server account, will fail also.

      Perl cannot solve permissions problems without correcting the permissions problem, and once you have done that, the batch file would work anyway, without needing to try re-write it in perl.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.