in reply to system command can't spawn cmd.exe

It sounds to my like the issue might be in your %PATH%, but cmd.exe really should be in C:\WINNT\system32\, which ought to be in your PATH. Try 'set PATH' to check this.

>> I need to use the batch file because the program it's
>> running assumes /program files/agent is the working dir

so if you added a 'chdir' call to your perl you could avoid the batch file? I'd probably try to do that, if it was my code...

Replies are listed 'Best First'.
Re^2: system command can't spawn cmd.exe
by nimdokk (Vicar) on Jan 12, 2005 at 14:46 UTC
    I'd recommend adding a chdir to the script. BAT files can be annoying when you have to call them from Perl scripts. Also, it may not necessarily be the BAT file in and of itself, but if its calling an executable thats assuming a certain directory, then things get trickier. The whole process is annoying and requires patience to get it working correctly.