files-community / files-community/Files

Bug: Context Menu: Dotfiles fail to launch or display "Open with" submenu depending on association count

Open
#18,493 7 comments 0 reactions 0 assignees View on GitHub
area - context menu needs - reproducing
Dominant language
C#
Stars
45.4k
Forks
2.9k
Avg merge
19h 1m
Merged PRs (30d)
60

Description

### Description

The Files app fails to open dotfiles (files with an empty base name, like `.Rhistory`) or trigger the "Open with" dialog, and the behavior changes depending on the number of active file associations in the system.

**Expected behavior**
- Double-clicking a dotfile with a default association should launch the file in the default app.
- Clicking "Open with" on a dotfile with 0 or 1 association should trigger the Windows `OpenWith.exe` dialog or correctly expand the submenu.

**Actual behavior**
The Files app completely fails to open dotfiles or launch the "Open with" dialog unless there are two or more active app associations for that specific extension.

**Additional context**
- The root cause is strictly tied to files lacking a base name (no characters before the dot).
- Native Windows Explorer handles all these scenarios correctly.
- CLI execution (`OpenWith.exe C:\path\to\.testext`) works perfectly, regardless of the current amount of active file associations.
- This indicates the bug lies within the Files app's parsing logic for empty base names, which breaks both the default launch action and the fallback `OpenWith.exe` trigger.

### Steps To Reproduce

1. Create a file with no base name (e.g., `.testext`).
2. **Scenario A (0 associations):** Right-click and select "Open with". The menu does not open, nor does it trigger the native `OpenWith.exe` dialog.
3. **Scenario B (1 default association):** Double-click the file. It fails to open. Right-click and select "Open with". The submenu fails to expand.
4. **Scenario C (2+ active associations):** Right-click and select "Open with". The submenu successfully expands, making this the *only* way to open the dotfile via the Files app UI.

### Files Version

4.1.1.0

### Windows Version

10.0.26100.8457

### User ID

18075659-2025-41af-9a75-06ace8d42180

### Log File

[debug.log](https://github.com/user-attachments/files/27862026/debug.log)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.