Skip to content

Error (shellExecute) when trying to open files from context menu #8786

@FuccDucc

Description

@FuccDucc

Description of the Issue

If you run Notepad++ in compatibility mode ("Run as Administrator"), you may get the following error when you try to open files using the Windows context menu (that is, right click the file and select "Edit with Notepad++"):

ShellExecute failed (2): Is this command correct?
"C:\Program Files\Notepad++\notepad++.exe"
"C:\Users\Username\Desktop\textfile.txt"

The window name is "Notepad++ Extension: Error" and the window icon is Windows Explorer icon. Even though this happens for me with a clean installation of Notepad++, so without any non-standard extensions or plugins.

Screenshot of the error:
error

Steps to Reproduce the Issue

  1. Install Notepad++ 7.8.9 (x64)
  2. Go to Notepad++ install folder and right click notepad++.exe file > properties > compatibility > enable "Run this program as Administrator"
  3. Right-click any file on your hard disk that Notepad++ can open, and select "Edit with Notepad++"
  4. Observe error

Expected Behavior

Notepad++ should be able to open files in this manner despite running itself as Administrator. Some people intuitively want to run editors like Notepad++ as admin, to avoid errors of a lack of file access or locked files for which Notepad++ asks the user to restart with administrator privileges, in order to be able to save it. These advanced users might enable this setting in compatibility tab, no matter how effective it is, and will now run into this unnecesary error, and will probably have a hard time figuring out the reason for their error.

Actual Behavior

Notepad++ couldn't open a file using the context menu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions