Skip to content

Bug: Incorrect Working Directory When Launching via "Open With" #17481

@CommandPrompt-Wang

Description

@CommandPrompt-Wang

Description

This is an issue related to the execution logic of the right-click context menu "Open With" submenu.
When launching an app via Files UWP's right-click "Open With", the working directory is incorrectly set to System32

  • Additional Information:
    • When launching via double-click (using default file association), the working directory is correct. The issue only occurs when launching via the "Open With" menu.
    • This suggests that the "Open With" menu item's code may not properly set the lpDirectory parameter when calling ShellExecute or a similar API.

Steps To Reproduce

  1. In Files UWP, right-click on an executable file or script (such as a .jar or .py file).
  2. Select "Open With" > Choose a program (e.g., Java or Python).
  3. The application is launched successfully, but its "current working directory" is set to C:\Windows\System32, instead of the directory where the file is located.
  4. This causes many applications that rely on the working directory to locate resources, configurations, or save files to fail to run properly.
output2_small_x264.mp4

Files Version

3.9.1.0

Windows Version

10.0.26100.4652 WorkStation

User ID

No response

Log File

debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    area - context menuFeatures or bug reports relating to the context menuneeds - additional infoNeeds more information from the reporter

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions