Skip to content

Windows Command regression - broken paths #95178

Closed
@Awpteamoose

Description

@Awpteamoose

Code

I tried this code:

fn main() {
	std::process::Command::new("folder/echo.bat")
		.args(["hello"])
		.status()
		.unwrap();
}

where folder/echo.bat is

echo %*

I expected to see this happen:

   Compiling repro v0.1.0 (D:\projects\2022-03-20-repro)
    Finished dev [unoptimized + debuginfo] target(s) in 1.03s
     Running `target\debug\repro.exe`

D:\projects\2022-03-20-repro>echo hello
hello

Instead, this happened:

   Compiling repro v0.1.0 (D:\projects\2022-03-20-repro)
    Finished dev [unoptimized + debuginfo] target(s) in 0.95s
     Running `target\debug\repro.exe`

The system cannot find the path specified.

Version it worked on

rustc --version --verbose:

rustc 1.61.0-nightly (1bfe40d11 2022-03-18)
binary: rustc
commit-hash: 1bfe40d11c3630254504fb73eeccfca28d50df52
commit-date: 2022-03-18
host: x86_64-pc-windows-msvc
release: 1.61.0-nightly
LLVM version: 14.0.0

(aka nightly-2022-03-19)

Version with regression

rustc --version --verbose:

rustc 1.61.0-nightly (8d60bf427 2022-03-19)
binary: rustc
commit-hash: 8d60bf427a4b055f464122062e76b3ec34d4f8ba
commit-date: 2022-03-19
host: x86_64-pc-windows-msvc
release: 1.61.0-nightly
LLVM version: 14.0.0

(aka nightly-2022-03-20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.P-mediumMedium priorityregression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions