[Issue 10863] New: [Win] executeShell() fails with spaces in cmd paths, unlike old shell()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 20 18:26:51 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10863

           Summary: [Win] executeShell() fails with spaces in cmd paths,
                    unlike old shell()
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: cbkbbejeap at mailinator.com


--- Comment #0 from Nick Sabalausky <cbkbbejeap at mailinator.com> 2013-08-20 18:26:48 PDT ---
On Windows:

-------------------------
import std.process;
import std.stdio;
void main()
{
    // Works. However, shell() is scheduled for
    // deprecation in favor of executeShell()
    writeln( shell(`"cmd with spaces.exe" --help`) );

    // Fails:
    // '"cmd with spaces.exe' is not recognized as an internal or external
command, operable program or batch file.
    writeln( executeShell(`"cmd with spaces.exe" --help`).output );
}
-------------------------

On Linux, the equivalent code (replacing single quotes with double quotes)
works fine on both shell() and executeShell().

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list