in reply to Executing windows batch files via System

Does it work when you run the script from a Console prompt? I don't have any problems running a batch file using system:

>copy con batch.bat @echo off echo Running! ^Z 1 file(s) copied. >perl -e"system 'batch.bat'" Running!

If it runs from the prompt, then it's likely to be a permission problem (since the script is surely being run as another user) or an access problem (from running as a service).

By the way, running the the kid asynchronously seems peculiar in this situation. I think system(1, ...) should be system(...) in this case.

Replies are listed 'Best First'.
Re^2: Executing windows batch files via System
by mitbeaver (Initiate) on Apr 26, 2007 at 00:53 UTC
    Thanks for your input, I changed the permissions and instead of getting the -1 output from system I get the value 65280, but the batch file doesn't create the installer in which is the point of the batch file