Skip to content

Set working directory on Windows to avoid UNC path warning - #33

Open
nagayasu-shinya wants to merge 1 commit into
rom1v:masterfrom
nagayasu-shinya:fix/unc-path-warning
Open

Set working directory on Windows to avoid UNC path warning#33
nagayasu-shinya wants to merge 1 commit into
rom1v:masterfrom
nagayasu-shinya:fix/unc-path-warning

Conversation

@nagayasu-shinya

Copy link
Copy Markdown

When running autoadb from a UNC path (e.g. WSL's \\wsl.localhost\...), cmd.exe prints a warning:

  '\\wsl.localhost\Ubuntu-24.04\home\nagayasu\work\autoadb'
  CMD.EXE was started with the above path as the current directory.
  UNC paths are not supported. Defaulting to Windows directory.

This sets the working directory to C:\ on Windows before spawning the child process, suppressing the warning.

Tested on

  • WSL2 (Ubuntu 24.04) running autoadb.exe cross-compiled with x86_64-pc-windows-gnu

Before

$ target/x86_64-pc-windows-gnu/release/autoadb.exe cmd.exe /C echo {}
Detected device 5e524998
'\wsl.localhost\Ubuntu-24.04\home\nagayasu\work\autoadb'
  CMD.EXE was started with the above path as the current directory.
  UNC paths are not supported. Defaulting to Windows directory.
5e524998

after

$ target/x86_64-pc-windows-gnu/release/autoadb.exe cmd.exe /C echo {}
Detected device 5e524998
5e524998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant