Home » Blog
date 10.Jul.2024

■ Discover broken file and folder shortcuts

A professed advantage of windows shortcut files arrow overlay over other types of links is that you can rename or move the target file or folder and the LNK file remains updated to the new location. This convenience is offered by the Distributed Link Tracking service which normally runs in the background for you.

Sometimes e.g. when you copy files from other PCs, the connection between LNK shortcut and target file is lost, and must be repaired. But how do you find these broken links? I am glad you asked because xplorer² can do it for you! Here are the steps:

  1. Find all shortcuts. Windows shortcuts have a hidden LNK extension, so you browse your Documents folder (or even higher ThisPC) and issue a file search command <Ctrl+F> for the filename wildcard *.LNK
  2. See target objects. (optionally) turn on Shortcut to stock column using View > Select columns menu command. However you don't need to examine the target paths individually, see below
  3. Check target paths. Using the programmable column feature of ultimate edition, create a rule that checks whether the path exists or not as such:
    EXISTS(${Shortcut to}) = 0

This will flag all broken links with 1 (=TRUE). Click on Programmable column header to sort by these values, so that all the broken LNK items are bunched together (0 means that the link is valid)

broken LNK detection

Detection was the easy step; to fix the broken links xplorer² cannot be as obliging to "autocorrect" them for you. What you can do is select all broken items with 1 in the programmable column (either manually or use the programmable property as a mark rule), and export the text including the Link target (shortcut to) information to Excel using Edit > Export CSV menu command.

In the worst case you should search for all target filenames (without the path) one by one to see where they are placed, and then recreate the broken link (Copy the target then use Edit > Paste link menu to create a new shortcut.

Post a comment on this topic »

©2002-2024 ZABKAT LTD, all rights reserved | Privacy policy | Sitemap