ActiveState Community

can't spawn cmd.exe no such file or directory at

Posted by ms10380 on 2009-10-14 10:51

I have the following line that is used to call an exe and redirct the output to a log.

system ($some_exe." >> exe.log");

Everytime I get to this line, the command executed but I also receive
"can't spawn cmd.exe no such file or directory at 'script line #'" error printed to the screen. What can I do to get rid of this message?

I have tried this with everything being defined in the variable
system ($come_variable);

and with everything explicitly called out
system ("C:\\Progra~1\some_exe >> exe.log");

But I always get the error.

I am running Active Perl 5.10.1 Build 1006

Thanks

lado | Tue, 2009-11-10 02:55

Perl's system expects exe path&name to be in first param, command line parameters in the other. So proper statement would be:

system ($some_exe, " >> exe.log");