Hi,
should a program open when its .lnk shortcut is clicked in the list, or file open with its default?
Double clicking on a .lnk file, in the file window, I get a scripting window with an error about currents script being recursive, if I ignore, "A User-Defined Command (#1400) is not allowed to call itself." pops up.
My #1400 UDC is a script that puts "default or TextPad opens" in the first line of the "open with" menu
Have I missed a config setting after all those years, or is it some sort of a safety feature?
Could not find an yanswer by search, sorry.
Can someone put me out of my misery, please?
Thanks and regards Emil
How to open program from a .lnk file ?
-
Kucera
- Posts: 108
- Joined: 31 Mar 2008 01:37
- Location: Canada
- Contact:
-
highend
- Posts: 15004
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: How to open program from a .lnk file ?
Mh?
it is really supposed to do...
- To which item (with full path) does the .lnk refer to?
- Show your CFA definitions
- Show the UDC command with the full script
"Open with" items are populated via CFAs (Custom File Associations) so I have no clue how your script looks like or whatMy #1400 UDC is a script that puts "default or TextPad opens" in the first line of the "open with" menu
it is really supposed to do...
- To which item (with full path) does the .lnk refer to?
- Show your CFA definitions
- Show the UDC command with the full script
One of my scripts helped you out? Please donate via Paypal
-
Kucera
- Posts: 108
- Joined: 31 Mar 2008 01:37
- Location: Canada
- Contact:
Re: How to open program from a .lnk file ?
It does not matter which path, any .lnk click gets a similar scripting window.highend wrote: - To which item (with full path) does the .lnk refer to?
- Show your CFA definitions
- Show the UDC command with the full script
The script is ancient, donated many years ago by a kind member of this forum
Please see the zip for the definitions and the script.
Regards Emil
To see the attached files, you need to log into the forum.
-
jupe
- Posts: 3478
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: How to open program from a .lnk file ?
One way that should fix it for you is to just add the following as the top line in your CFA
Code: Select all
lnk>#-
Kucera
- Posts: 108
- Joined: 31 Mar 2008 01:37
- Location: Canada
- Contact:
Re: How to open program from a .lnk file ?
Thanks, that works fine for the .lnk shortcuts. Unfortunately it kills pretty much all the other CFAs if there are other files in the directory, I mean, the many choices for, say, a pdf file do not show in the CFA menu. Still, if there is no other way, it would solve my immediate problem, and for most of the time I can keep that line inactive.jupe wrote:One way that should fix it for you is to just add the following as the top line in your CFACode: Select all
lnk>#
For my edification - just how does that one line work?
Thanks and regards Emil
-
jupe
- Posts: 3478
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: How to open program from a .lnk file ?
It redirects lnk files to the system default, bypassing your other CFA entries, it shouldn't have an effect on anything other than lnk files so if you are having problems with pdf etc, its strange.Kucera wrote:For my edification - just how does that one line work?
Are you selecting a pdf file? it should be the same with and without the entry I suggested enabled, or are the lnk files linking to pdfs?Kucera wrote: I mean, the many choices for, say, a pdf file do not show in the CFA menu
When you say there are missing entries what file type do you have selected?, or are you selecting a folder?
-
highend
- Posts: 15004
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: How to open program from a .lnk file ?
One way to fix your script is:
Replace:
with:
Replace:
Code: Select all
//Msg("Open $items in windows.<br>$verb", 1);
#1053;
Code: Select all
//Msg("Open $items in windows.<br>$verb", 1);
if ($ext LikeI "lnk") {
$item = regexreplace($selItem, ';""$|"');
$item = property("#LinkTarget", $item);
if (exists($item) == 1) { run """$item"""; }
} else {
#1053;
}
One of my scripts helped you out? Please donate via Paypal
-
Kucera
- Posts: 108
- Joined: 31 Mar 2008 01:37
- Location: Canada
- Contact:
Re: How to open program from a .lnk file ?
You are right, it works the same checked or unchecked for normal files, just the .lnk files give limited choice or on double click open directly with their default program (see screenshots in the zip). That is plenty good for my needs. Thanks very much.jupe wrote: Are you selecting a pdf file? it should be the same with and without the entry I suggested enabled, or are the lnk files linking to pdfs?
When you say there are missing entries what file type do you have selected?, or are you selecting a folder?
Regards Emil
To see the attached files, you need to log into the forum.
-
Kucera
- Posts: 108
- Joined: 31 Mar 2008 01:37
- Location: Canada
- Contact:
Re: How to open program from a .lnk file ?
highend wrote:One way to fix your script is:
Replace:Code: Select all
with [code][/quote] Thank you very much. I will try changing the script when I have some more time, for now the fix suggested by Jupe (see above msges) gives me what I need. This is one great forum! Thanks again, guys. Regards Emil
XYplorer Beta Club