Page 1 of 1

Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 01:55
by o7blue
In vanilla explorer if I move a file or directory that has a shortcut to it somewhere else in the system, the shortcut won't break and will instead update its target location.
Moving shortcut targets inside XY breaks the shortcut since it'll point to the old (nonexistent) location.

Is this vanilla explorer behavior something I could achieve with a script that would check if the item has a shortcut pointing to it on all move/rename operations? It's not ideal having to recreate a whole bunch of shortcuts if I need to move things around.

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 08:53
by highend
Mh?

In Windows Explorer, Windows Server 2019 x64:

I have:

Code: Select all

E:\tst

with 2 folders inside of it:
E:\tst\a
E:\tst\b
If I create a normal shortcut by right clicking E:\tst\b and use "Create shortcut"
I now have: E:\tst\b - Shortcut.lnk
Now I move this shortcut one level up so I get: E:\b - Shortcut.lnk

Now I rename E:\tst to E:\testing
but the E:\b - Shortcut.lnk will still point to E:\tst\b and NOT to E:\testing\b?

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 09:25
by RalphM
Not sure if OP is referring to Windows Explorer with Vanilla, there is apparently a Vanilla Explorer for Android out there.
Only OP can answer this.

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 09:40
by o7blue
Here's a video showing that the shortcut doesn't break when moving or renaming the target file:

https://mega.nz/file/w3JjQCCK#jbG-9cxXw ... c8aQluxEZQ

@RalphM: vanilla windows 10 explorer, no idea that was a thing for Android :o

EDIT:

@highend: here's a video recreating your scenario: https://mega.nz/file/Q6w3FSBJ#nXr3_-_2W ... -DGmIYR_nk
You can see the target change after it is accessed

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 09:53
by highend
You can see the target change after it is accessed
That's the key, after it has been accessed.

That's the same behaviour I can see within XYplorer, no difference.

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 10:00
by o7blue
That's not what I'm experiencing, here's a video of the shortcut breaking during the same operation in XY:
https://mega.nz/file/Z3wliAiT#HneJkrAoh ... gx2jyu1eEU

Is there a configuration setting I'm missing?

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 10:05
by highend
Start a fresh instance by executing fresh; from the address bar. Does it work there?

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 10:09
by o7blue
Nope. It's literally the same result as in the above video. I take it you have a different result from mine?
I'm on version 21.40, so afaik that's the latest release.

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 10:31
by highend
v21.40, fresh instance (apart from hiding the tree and disabling dual pane), video attached...
1.zip

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 10:45
by o7blue
I'm able to reproduce your result with renaming the text file, but I'm not getting the folder behavior. Are you not getting the 'location unavailable' message when trying to open a shortcut to a moved or renamed directory?

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 10:54
by highend
Right click the "Open with" button in the toolbar and untick
Open Items by First 'Open With...' match

Try it again with a folder (link)

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 11:07
by o7blue
This results in the more standard error message:
Untitled.png

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 11:12
by highend
Funny, I don't get that error message...

Maybe Don can shine some light on it if it should work or why it doesn't...

Re: Is it possible to track and update .lnk targets like vanilla explorer can?

Posted: 11 Jan 2021 11:21
by o7blue
This is probably the first time I've gotten the short end of the 'but it works on my machine' stick :biggrin:
Clearly, the only solution now is for me to spin up a VM of your configuration :whistle:

But in all seriousness, I hope this isn't a big bug to fix.