in reply to Can't spawn "cmd.exe":

Independent of the problem you are reporting, your usage of system (as follows) is wrong.
my $test = "/C \"C:\\...\\EXCEL.EXE\" C:\\test.xls"; system ("cmd",$test);
You can either pass the whole command as one argument:
my $test = "/C \"C:\\...\\EXCEL.EXE\" C:\\test.xls"; system ("cmd $test");
or pass the arguments separately (note the lack of quotes):
my @test= ("/C", "C:\\...\\EXCEL.EXE", "C:\\test.xls"); system ("cmd", @test);

You are currently relying on a bug.

Replies are listed 'Best First'.
Re^2: Can't spawn "cmd.exe":
by BrowserUk (Patriarch) on Mar 18, 2009 at 16:54 UTC
      system documents that the value of $test in system ("cmd",$test); will be passed as a single argument. If system behaved as documented, it would execute
      cmd "/C excel.exe text.xls"

      cmd does not accept that.