Skip to content

Bug when used for paths with spaces #27

Closed
@pderouen

Description

@pderouen

This code does not work when the command contains a path with spaces:

let mut c = Command::new("cmd");
c.arg("/C").arg(&cmd);
return c;

According to this comment using cmd /C command_to_execute argument is "normally" not needed. But, I suppose we have a case where it is needed.
https://stackoverflow.com/questions/44757893/cmd-c-doesnt-work-in-rust-when-command-includes-spaces

If I construct the return value exactly the same way as it's done for Linux, I don't have any issue. What led to the need for executing like this on Windows?

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions