Skip to content

getLoginItemSettings() fails to detect Windows launchItems when executable path contains spaces #53911

Closed

Description

@Dxg125

Preflight Checklist

Electron Version

43.4.1

What operating system(s) are you using?

Windows

Operating System Version

Windows 11 Enterprise 23H2

What arch are you using?

x64

Last Known Working Electron version

No response

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

TL;DR

Electron.app.getLoginItemSettings()
did not yield the valid item.

Electron.app.getLoginItemSettings({path: "${process.execPath}"})
did yield the correct item

The space inside the parental path seems to cause trouble: "C:\Program Files\AppName\AppName.exe"

Actual Behavior

It does not yield the correct launchItems if parental path contains spaces.

In "Electron Fiddle", i could also reproduce this issue with:
"C:\Users\Username\AppData\Roaming\Electron Fiddle\electron-bin\current\electron.exe"

Testcase Gist URL

https://gist.github.com/Dxg125/6e8bfb9dd77ec487519114018b8c9994

Additional Information

It also happens on Win 11 24H2 / 26100.9445

Activity

  1. added theissue type on Sep 14, 2026
  2. added
    has-repro-gist
    on Sep 14, 2026
  3. nikwen commented on Sep 14, 2026

    @nikwen
    Member

    There was a breaking change related to spaces in paths in #50016.

    Before, paths needed to be quoted. Now, that should no longer be necessary. If it is, that's a bug.

  4. Dxg125 commented on Sep 15, 2026

    @Dxg125
    Author

    It seems that way: Re-tested on Electron Fiddle with "v44.3.0", "44.2.0", "v44.1.1" and on "v43.7.0".

    The output is basically the same for the diff. versions:

    Console ready 🔬
    Saving files to temp directory...
    Saved files to C:\Users\Username\AppData\Local\Temp\electron-fiddle-28712-5tLTk7qaDvzK
    Electron v44.3.0 started.

    For help, see: https://nodejs.org/learn/getting-started/debugging
    process.execPath: C:\Users\Username\AppData\Roaming\Electron Fiddle\electron-bin\current\electron.exe

    Default: {
    launchItems: [],
    executableWillLaunchAtLogin: false,
    openAtLogin: false,
    wasOpenedAtLogin: false
    }

    Explicit path: {
    launchItems: [],
    executableWillLaunchAtLogin: false,
    openAtLogin: false,
    wasOpenedAtLogin: false
    }

    Quoted path: {
    launchItems: [
    {
    name: 'ElectronLoginItemRepro',
    path: 'C:\Users\Username\AppData\Roaming\Electron Fiddle\electron-bin\current\electron.exe',
    args: [],
    scope: 'user',
    enabled: true
    }
    ],
    executableWillLaunchAtLogin: true,
    openAtLogin: false,
    wasOpenedAtLogin: false
    }

    Electron exited with code 0.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    43-x-ybug 🪲has-repro-gistplatform/windows

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions