Skip to content

current_exe return \\\?\\ prefix symbols #99931

Closed
@bmiyuan

Description

@bmiyuan

Background:
I use current_exe() on Windows, but std::env::current_exe() return "\\?\D:\code\test\target\debug\test.exe"

Steps to Reproduce:
fn main() {
let program_dir=std::env::current_exe().unwrap();
println!("program_dir {:?}",&program_dir);
}

Rust Version:
rustc 1.62.1 (e092d0b 2022-07-16)

Expected Behavior:
I would expect to get:
"D:\code\test\target\debug\test.exe"

Actual Behavior:
"\\?\D:\code\test\target\debug\test.exe"

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions