in reply to Re^2: Can't spawn "cmd.exe":
in thread Can't spawn "cmd.exe":

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.

Replies are listed 'Best First'.
Re^4: Can't spawn "cmd.exe":
by BrowserUk (Patriarch) on Mar 18, 2009 at 18:36 UTC
      Really.
      >cmd "/C dir" 'dir"' is not recognized as an internal or external command, operable program or batch file. >cmd /C dir Volume in drive C is C Volume Serial Number is 28AB-0E8B Directory of C:\Documents and Settings\ikegami 2009/03/18 03:49 PM <DIR> . 2009/03/18 03:49 PM <DIR> .. ...

      That's the one I had used to test earlier, but it turns out cmd is very forgiving for practically all other commands.

        Seems more like a bug in cmd.exe to me

        C:\test\test\test>cmd "/c dir *" Volume in drive C has no label. Volume Serial Number is 8C78-4B42 Directory of C:\test\test\test 18/03/2009 20:13 <DIR> . 18/03/2009 20:13 <DIR> .. ... C:\test\test\test>cmd "/c dir " Volume in drive C has no label. Volume Serial Number is 8C78-4B42 Directory of C:\test\test\test 18/03/2009 20:13 <DIR> . 18/03/2009 20:13 <DIR> .. ...

        One swallow does not a summer make :)


        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.