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

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.

Replies are listed 'Best First'.
Re^6: Can't spawn "cmd.exe":
by BrowserUk (Patriarch) on Mar 18, 2009 at 23:15 UTC

    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.

      One swallow does not a summer make :)

      Are you talking about dir being unique, or cmd being unique? :)

      I agree it's sensible to use system("cmd", $args). Note that it doesn't generalize to system($prog, $args). Try perl "-l foo.pl", for example.