1.    22 Mar 2017 #1
    Join Date : Oct 2015
    B)
    Posts : 34
    10 Enterprise LTSB

    Looking for: Dead Shortcut/Link (.LNK) Finder


    Does anyone know of an app/script to:
    1. scan whole folder/drive
    2. find all files ending in .lnk (i.e. shortcuts)
    3. if the thing that it's pointing to does not exist -> alert me / flag it / delete it / etc

    I'll continue searching online, but I must not be using the right keywords or it's hard to find.
      My ComputerSystem Spec
  2.    22 Mar 2017 #2
    Join Date : Jul 2015
    Posts : 3,758
    10 Pro

    You could copy/paste this into powershell. It will make a file MissingTargets.txt on your desktop containing shortcuts where the target doesn't exist. Just need to change the drive letter D:\ in the first line.
    Code:
    $Shortcuts = Get-ChildItem -Recurse "D:\" -Include *.lnk
    
    $Shell = New-Object -ComObject WScript.Shell
    foreach ($Shortcut in $Shortcuts)
    {
    	$Properties = @{
    	ShortcutName = $Shortcut.Name
    	Path = $Shortcut.FullName
    	ShortcutDirectory = $Shortcut.DirectoryName
    	Target = $Shell.CreateShortcut($Shortcut).targetpath
    	}
    	New-Object PSObject -Property $Properties
    
    	if (-not (Test-Path $Properties.Target)) {$Properties.Path>>$env:homeDrive$env:homePath\Desktop\MissingTargets.txt} 
    }
    If you wanted to delete them instead of reporting them then change the line at the end from
    Code:
    if (-not (Test-Path $Properties.Target)) {$Properties.Path>>$env:homeDrive$env:homePath\Desktop\MissingTargets.txt}
    to
    Code:
    if (-not (Test-Path $Properties.Target)) {Remove-Item $Properties.Path -Force -ErrorAction 0}
    Based on this code [Powershell] Get Shortcut Target : AskGreg
      My ComputerSystem Spec
  3.    22 Mar 2017 #3
    Join Date : Jan 2015
    UK, Midlands
    Posts : 11,079
    Win 10 Pro (1703)

    This is pretty good:
    Fix Shortcuts - Scan and Fix broken shorcuts on you computer
    That states Win 10 compatible. Freeware for personal use.
    http://www.puransoftware.com/screens...xShortcuts.jpg
    Click image for larger version. 

Name:	FixShortcuts.jpg 
Views:	1 
Size:	83.9 KB 
ID:	126162
    ===========================================
    Older tool here:
    Search, Identify And Resolve Broken Shortcuts
    (not tried)

    (Searched for "detect scan for dead shortcuts")
    Attached Thumbnails Attached Thumbnails Snap 2017-03-22 at 08.05.49.jpg  
    Last edited by dalchina; 22 Mar 2017 at 03:32.
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
Tray Icon link for shortcut
Hi, everyone This little one want to ask some weird questions. Just as the thread say, yes i know it's weird to have this question, but i really need it so for anyone who know what the link of all of this tray icon list -battery -wifi
General Support
2 Brief Questions: A Shortcut for Amazon and a new Bookmark Link
Shortcut for amazon........ How do you create a shortcut for Amazon.com ? I use Amazon to buy stuff (usually books), but I also use them for reviews and learning about a product. I am using it more than ever now and I thought it would be...
Browsers and Email
"check for updates" is a dead link
when I click on search and type "check for updates", or "windows updates settings", I can't open the result. I click, and nothing happens. But if I go to "settings", and then to "update and security", it opens just fine. What is the matter with...
Windows Updates and Activation
Solved How to add shortcut link in Quick Access through Registry
Hi, I want to add shortcut link of one of the folder location to "Quick Access" in Windows 10 x64. In the case of Windows 10 x86 I used to put my shortcut link in the folder "C:\Users\user_name\Links" & it showed me shortcut in favorites...
General Support
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:21.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums