Automating the cleanup of broken desktop shortcuts can streamline system maintenance and remove clutter. Below is a Windows-based PowerShell script that identifies and deletes broken .lnk (shortcut) files on the desktop.
PowerShell Script to Remove Broken Desktop Shortcuts
How to Use
-
Open PowerShell as Administrator
-
Copy and paste the script into the PowerShell window or save it as
CleanBrokenShortcuts.ps1. -
Run the script by pressing Enter or executing:
Optional Enhancements
-
Run as a scheduled task weekly or monthly.
-
Log deleted shortcuts to a text file:
-
Scan all user desktops:
This script is safe, quick, and effective for routine desktop maintenance on Windows systems.
Share this Page your favorite way: Click any app below to share.