Fixing Disappearing Desktop Shortcuts in Windows 7

Published on
36,352 Points
16 Endorsements
Last Modified:
If you've occasionally noticed missing shortcuts from your Windows 7 Desktop, it's because Windows 7 runs maintenance tasks periodically and cleans up things that don't work.  One of these tasks is to clean up and remove broken shortcuts on your desktop.  If you have more than 4 or more broken shortcuts, on the desktop when the maintenance occurs, Windows will automatically delete them (after all, who wants broken shortcuts on their desktop).

What does Windows consider a broken shortcut?  A shortcut to a file that's no longer available, a shortcut to a network drive that's no longer available, or a shortcut to a program that's no longer available would all be examples.  People who create a shortcut to a work report on their desktop at home that they access via VPN would be considered broken if the maintenance routines run when they are not connected to the VPN.  A shortcut to the network drive that contains all your office files on your office server would be considered broken if it were on a laptop that was taken on a trip.  A shortcut to a program that you placed on the desktop but since have uninstalled would also be considered broken.  And if you have more than 3 of these TOTAL, then Windows will delete them all, by default, when the maintenance is done.

Microsoft suggests two things to prevent this in their support article (Desktop shortcuts disappear in Windows 7; KB 978980) on the subject - neither of which seems very appealing.  


Don't put shortcuts on your desktop that can be broken at times (this suggestion, to me, is silly at best)


Disable the System Maintenance troubleshooter, which will disable all the maintenance tasks that it performs (this seems extreme and generally unwise)
As a third option, you can do the following - just be careful, any time you modify system settings one wrong keystroke at the wrong time could have seriously damaging results:


Take Ownership of the file C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1


Adjust the permissions on the file same file so that your user account has full control


Right-click and select "edit" on the file - OR open notepad with administrative rights and then open the file in notepad.
Then change the file so that lines 12 through 20 begin with a # symbol - like this:
#    Get-ChildItem -Path $path -filter *.lnk | Foreach-Object {
#        $fullPath = ConvertTo-WQLPath $_.FullName
#        $wmiLinkFile = Get-WmiObject -query "SELECT Name,Target,AccessMask FROM Win32_ShortcutFile WHERE Name = '$fullPath'"
#        if(-not(Test-ValidLink $wmiLinkFile) -and (Test-Delete $wmiLinkFile))
#        {
#            $list = AttachTo-List $list $wmiLinkFile.Name
#        }
#    }

Open in new window


Save the file
That should do it.  You've just changed the script that does the desktop cleanup so that whenever it runs, it should find no broken links at all - the function that would have found them should always return an empty list.  (The # comments out the line so, if you ever want to restore the functionality, you just need to remove the # symbols starting each of those lines - just be careful not to remove them from lines 1, 3, or 8 as those are actual "FYI" comments that belong there - like little notes explaining what's going on)

I found similar instructions on the internet, but decided to provide this version since I preserve the file in a state you can easily restore later; the other instructions I've found tell you to delete those lines and my philosophy is that it's always easier to undo something commented out than to recreate it or copy it from another system.
Author:Lee W, MVP
  • 2
LVL 99

Author Comment

by:Lee W, MVP
And thanks WaterStreet

Expert Comment

The specific issue seems to be when a user goes above 4 shortcuts which saw that there is an issue with a limitation of WMI class in windows 7.

However, the issue ONLY arises on stations which only have "power user" rights assigned to the local box.  Anyone with "admin or full rights" to the local box can create as many shortcuts as they want and they never disappear.  But the power user creates 4 shortcuts they are fine but when they create the 5th or more shortcuts, that makes all their shortcuts disappear either the next day or in a day or two.

If it is a limitation issue then why the seeming permissions affecting the issue?
LVL 99

Author Comment

by:Lee W, MVP
I wrote this up after one client experienced this.  However, that client makes the users Admins, NOT Power Users.  Personally, I have not seen the issue myself.  As the KB article makes no mention of user rights and permissions, I would suggest you take a closer look because it would seem the problem should occur to EVERYONE.

Featured Post

Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month