electron: showItemInFolder doesn't work on Windows if . is in the path

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 8.3.0
    • 7.1.9
  • Operating System:
    • Windows
  • Last Known Working Electron version:
    • 7.1.8

Expected Behavior

Use shell.showItemInFolder to show the contents of a folder:

shell.showItemInFolder("C:\\repos\\.");

Actual Behavior

The contents of the folder is show in file explorer.

To Reproduce

// show contents of some folder on your machine
shell.showItemInFolder("C:\\repos\\.");

Additional Information

  • I have a feeling that this is what broke this.
  • Using shell.openItem still results in the expected behavior, even if there is a . in the path
  • That said, this does not repro on macOS and Linux. So while I’d be fine with this not getting fixed and just being told “use openItem” because of the 2nd bullet, it’d be nice if the APIs were consistent across platforms. 🙃

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (12 by maintainers)

Most upvoted comments

I just encountered this issue at 12.0.4 and my path has a dot in the middle of it (eg C:/Folder.Name/file). But path.normalize is a workaround. (also gets rid of the backslash issue on windows: #11617) Thanks @KavenWork for pointing it out there

bump

On Fri, Oct 7, 2022, 10:20 PM github-actions[bot] @.***> wrote:

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, “bump”), and we’ll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron https://www.electronjs.org/releases/stable or in the beta https://www.electronjs.org/releases/beta—please include it with your comment!

— Reply to this email directly, view it on GitHub https://github.com/electron/electron/issues/23884#issuecomment-1272200196, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEPLHKCSQHD4MGA57QQOILWCDK5XANCNFSM4NP674EA . You are receiving this because you commented.Message ID: @.***>