Skip to content

Opening .lnk opens destination file for editing #9643

@levicki

Description

@levicki

Description of the Issue

As the title says, opening .lnk file using Notepad++ opens shortcut's destination file for editing.

Steps to Reproduce the Issue

  1. Navigate to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools using Explorer
  2. Right-click Registry Editor.lnk and select Edit with Notepad++.

Expected Behavior

Registry Editor.lnk file is opened for editing.

Actual Behavior

%windir%\regedit.exe file is opened for editing instead.

Debug Information

Notepad++ v7.9.1 (64-bit)
Build time : Nov 2 2020 - 01:07:46
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : ON
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19042.867
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll nppcrypt.dll NppExport.dll NPPJSONViewer.dll NppMarkdownPanel.dll

I see that there was an issue #8483 where someone requested this functionality.

If you wonder why would anyone want to edit .lnk file itself, I have at least two use cases:

  1. To delete its contents (i.e. to make a 0-byte file), and set it to hidden/system/readonly so that rude program installers and updaters cannot litter my start menu with shortcuts I don't need or use.
  2. To copy links of special shortcuts that are otherwise not possible to copy because they are grayed in shortcut properties dialog.

I also believe that a text editor should not be opening .exe files by default (unless it specifically supports modifications to PE/PE+ executable structure), because people can accidentally change and save them and thus break their programs or worse yet their Windows install.

If there is no option to turn this off then please consider it as a feature request.

If adding an option is too much of a hassle, then please at least exclude shortcuts to *.exe from opening the target instead of shortcut itself.

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