Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open target file on Drag and Drop a shortcut #8483

Closed
Yaron10 opened this issue Jun 26, 2020 · 9 comments
Closed

Open target file on Drag and Drop a shortcut #8483

Yaron10 opened this issue Jun 26, 2020 · 9 comments
Labels
bug verified Issues verified to be valid and reproducible, PRs that have been tested thoroughly

Comments

@Yaron10
Copy link

Yaron10 commented Jun 26, 2020

STR:
Create a Windows Shortcut (.lnk‬) to a text file.
Drag and drop the Shortcut into Notepad++.

Result:
The .lnk file is opened.

Expected Result:
The target text file should be opened.


Notepad++ v7.8.3 (32-bit)
Build time : Jan 17 2020 - 18:20:02
Path : C:---\notepad++.exe
Admin mode : ON
Local Conf mode : ON
OS Name : Windows 7 Enterprise (32-bit)
OS Build : 7601.23964
Plugins : ComparePlus.dll HTMLTag_unicode.dll MenuIcons.dll PythonScript.dll _CustomizeToolbar.dll

@sasumner
Copy link
Contributor

Verified on 7.8.7 32-bit.
If opening a .lnk file via File > Open , however, the target file is opened correctly.
A competitor has this same issue, or at least they did 8 years or so ago: https://sublimetext.userecho.com/communities/1/topics/3233-open-lnk-files-with-drag-and-drop-on-windows-is-not-opening-the-shortcuts-target-file

@sasumner sasumner added bug verified Issues verified to be valid and reproducible, PRs that have been tested thoroughly labels Jun 26, 2020
@Yaron10
Copy link
Author

Yaron10 commented Jun 26, 2020

👍
Works as expected in Firefox and another competitor (EditPad).

@sasumner
Copy link
Contributor

If the code shown HERE is integrated into Notepad++'s doOpen() function (at the top), it seems to open the target file of a .lnk file rather than the .lnk file itself. No special check needs to be done to see if an incoming argument has a .lnk extension, as the call to ResolveIt fails (harmlessly) if the filename does not "resolve" into something.

Not sure if there are any negative aspects to this; any comments are appreciated.

@Ekopalypse
Copy link
Contributor

Ekopalypse commented Jun 28, 2020

Yes, it looks like this is the recommended way of doing it.

@sasumner
Copy link
Contributor

it looks like this is the recommended way of doing it.

I saw that code; the code I cited used it in a "real world" way, so I chose that to link to instead.
Plus I had lost the M$ link by the time I found the one I used.

@KnIfER
Copy link

KnIfER commented Aug 29, 2020

Managed to add a 'Open Linked File' option in the TabBar Context Menu.

output_ConvertNo 0_SchivoNo 0_SchivoNo 0_GifNo 0

This can open an entire folder too...

@Yaron10
Copy link
Author

Yaron10 commented Aug 29, 2020

@KnIfER,

Why would you want to open the.lnk file?

@KnIfER
Copy link

KnIfER commented Aug 30, 2020

You mean why would I view the original text?

I can modify the .lnk file and then create relative short-cuts, which is not allowed but windows's property dialog——it think it's 'invalid'

@Yaron10
Copy link
Author

Yaron10 commented Aug 30, 2020

OK. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug verified Issues verified to be valid and reproducible, PRs that have been tested thoroughly
Projects
None yet
Development

No branches or pull requests

4 participants