Subject: Re: bug#18745: 24.3; MS Windows, `call-process-shell-command' fails on `shell-quote-argument'ed bat file with quoted args

From: Stefan Monnier <[email-masked]>
Date: Thu, 16 Oct 2014 16:15:28 -0400

>   (call-process-shell-command
>    "cmd.exe" nil t t
>    "/c \"c:/path with space/foo-bar.bat\" \"x y\"")

A few things to note:

- The "rest" arguments to call-process-shell-command are deprecated.
  I.e. you should use

    (call-process-shell-command
     "cmd.exe /c \"c:/path with space/foo-bar.bat\" \"x y\"" nil t t)

  instead (which is equivalent anyway, and I think it's more honest
  since it doesn't make it seem like those rest args are correctly
  separated).

- Why not use call-process instead (since you don't actually use the
  "shell-command" part, really)?
  Something like either

    (call-process "cmd.exe" nil t t
                  "/c" "\"c:/path with space/foo-bar.bat\" \"x y\"")
  or
    (call-process "c:/path with space/foo-bar.bat" nil t t "x" "y")

        Stefan