Skip to content

std::process::Command doesn't execute .COM files on Windows #42553

Closed
@cengiz-io

Description

@cengiz-io

Hello!

(This is probably just another case of #37380)

I'm working on #32665 and my implementation uses default pager executables depending on the platform. (less for *nix, more for Windows)

I spawn pager process like this

let pager = env::var("PAGER").unwrap_or(String::from("more"));

Command::new(pager).arg(file_path).output()

And that fails to run on Windows 10 due to this line: src/libstd/sys/windows/process.rs#L145

Since more is actually more.com, it needs to be executed with a different suffix than hardcoded .exe

There was a note about CreateProcess from @afiune but I don't know how that relates.

Thanks a lot!

cc @Mark-Simulacrum, @alexcrichton

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: WindowsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions